[ View menu ]

syntax error before ‘AT_NAME’ token

If you happen to be using Xcode and get this somewhat baffling error message when building:

syntax error before ‘AT_NAME’ token

The problem is that you are missing an @end in some file that you’ve #imported, probably a header file. This error also shows up as “parse error ...” in some versions of Xcode (took me a while to track down with Google as a result).

3 Comments

  1. Matthew Hall says:

    Thanks you saved me some pain! I’ve new to Xcode and its great to have practical tips like this recorded somewhere.

    December 8, 2007 @ 10:20 pm

  2. Mathieu says:

    It could be caused by something niggly like this!

    - (CGRect)xyz // <- no ; !

    @end

    December 16, 2007 @ 9:33 am

  3. Laurie says:

    Since that last comment isn’t very clear, and I just had to figure it out for myself…

    This error can also happen if you miss out a semicolon before a @whatever expression.

    For example


    - (void)draw;
    - (void)startRotate // note missing semicolon

    @end

    July 23, 2008 @ 5:13 pm

RSS feed Comments | TrackBack URI

Write Comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>