"Error: syntax before '@' token and Error: syntax at 'OTHER' token"
[SOLVED]
OK, so I know this is probably a very dumb question, but I am very new to programming, well computers in general... but I am catching on fairly quickly. I have run across these error messages and for the life of me can not figure out why I am getting them. I have not changed anything in my programming "style" or anything like that. I am using X-Code 3.0 and writing a very simple command tool following the iPhone Programming class from Stanford U. This is the error message and code I am getting from a custom class implementation.
-(id)description
{
NSString *descriptionString = [[NSString alloc] initWithFormat: @" Hello I am a %f sided polygon (aka a %@) with angles of %f degrees (%f radians).", (self.numberOfSides), (self.name), (self.angleInDegrees), (self.angleInRadians)];
return descriptionString;
}
I know this is not at all a sophisticated program or something that should be worried about but I am trying to learn and have spent hours scratching my head at this... I get three error messages: "Error: syntax before '@' token" and "Error: syntax at 'OTHER' token"(this one I get twice). Any help would be appreciated very much, and I will keep trying to solve this mystery myself. Thank you!
----------------------------------------------------------------------------------------------------------------------
Ok, well I fixed the problem. I do not know how but all I did was delete the method in both the header file and the implementation file and re-wrote it and it built fine with no errors or warnings.
Last edited by bullrider; 07-06-2009 at 07:59 PM.
Reason: problem solved
|