# NSBezierPath & stray 320 ?? :S



## maccatalan (Jul 10, 2003)

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.


----------



## maccatalan (Jul 10, 2003)

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


----------



## wiz (Jul 10, 2003)

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..)


----------



## maccatalan (Jul 11, 2003)

This used to work :


```
[[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 :


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

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


```
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 :


```
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


----------



## Darkshadow (Jul 11, 2003)

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.


----------



## maccatalan (Jul 11, 2003)

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


----------



## anarchie (Jul 12, 2003)

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.


----------



## Cocoaholic (Jul 14, 2003)

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.


----------



## maccatalan (Jul 14, 2003)

many thx to all,
you answered me fully  

I hope I will be able to help you in return one day


----------

