iPhone Developer Tips Stats: Past 30 days - Pageviews: 88,424 Visitors: 61,675 Thank you everyone! Let's shoot for 100,000 by May. Pass it on...
|
I recently ran into this error message within Xcode while writing an iPhone application. I was surprised how long it took to track this down. One of the reasons this is tricky is that message implies that the error occurred in the file referenced in the error message.
For example, in my case, I was looking inside the implementation file (.m) for something obvious to standout.
To get the context of what I am referring to, look at the figure below to see how the message appeared in Xcode on my system:

The crux of the problem was not SomeClass.m, it was one of the .h files imported inside this implementation file that didn’t have a closing @end statement.
Sounds easy enough doesn’t it? Well, most everything is once you’ve found what the problem is. Hopefully this will save you some time if ever encounter this message.
Comments
One Response to “Error: syntax error before ‘AT_NAME’ token”
Leave Comment
this can also happen when the .h file has a syntax error, such as the last line not having a “;”