NSBezierPath & stray 320 ?? :S

maccatalan

Registered
Hi.

a source that compiled very well before now does not with the following error.

Here is the code :

[[NSBezierPath bezierPathWithOvalInRect:rect]_fill];

When I let this "as it" I get compilation errors :

stray '\320' in program
stray '\240' in program

When I replace the draw-oval-in-rect instruction by :

NSRectFill(rect);

then it works very well.

This problem depends only on the NSBezierPath instruction. I tried it on other projects, even empty projets and ... nothing to do. Always the same two ununderstable errors.

Thx for your help,
Pierre.
 
the problem seems to come from the NSBezierPath itself ... since when I call [NSBezierPath bezierPathWithRect:rect] I get the same errors :'(

thx for the help,
Pierre
 
it worked? and all of a sudden it stops working? what did you do? upgraded to 3.3? .. or..?

(just curious.. i have no clue whats going on..)
 
This used to work :

Code:
[[NSBezierPath bezierPathWithOvalInRect:dotRect] fill];

(it comes from 'Learning Cocoa' book, chapter 8, page 137).

However now I get two errors when trying to compile it or similar instructions like :

Code:
[[NSBezierPath bezierPathWithRect:dotRect] fill];

The errors (which I don't understant ... if anyone could tell us what do they mean) are :

Code:
stray '\320' in program
stray '\240' in program

I don't know what this means but it stops the compilation.


However now it works ... Don't ask me why but here is the code I used :

Code:
NSBezierPath * aPath = [[NSBezierPath bezierPath] retain];
[aPath appendBezierPathWithOvalInRect:aRect];
[aPath fill];
[aPath release];

Since now it works ... no problem. Engineer method ;) . However can anyone tell what changed since the Learning Cocoa release ?
And what does "stray '\320' in program" mean ??

thx,
Pierre
 
That looks like a character code. I dunno what it is...but when you changed the line to the above, did you totally delete the old line?

It could have been some invisible characters were in the line somewhere, and deleting it took 'em out.
 
I don't think so because I deleted the old line and more over just retyping it (not copy/paste) the effect is the same and I tryed it with several projects ... I do not understand. :(

the idea of character codes is not bad. But what is a 'stray' ?

thx
Pierre
 
A stray is something that doesn't belong where it is. I guess the compiler decided that since \320 wasn't code, it was in the wrong place.

I think Obj-C works the way C++ used to: Obj-C constructs are first preprocessed into C, then C is compiled. A bug probably caused some bogus characters to be generated from the call to NSBezierPath.
 
This happens to me when i copy/paste code from websites...
Deleting all lines/whitespace in between lines and re-applying it works for me.
 
Back
Top