Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

missing @end + expected identifier "{" errors in XCode 4.2 .h module

Tags:

I can't get rid of two errors on my class module, even when I have simplified the code to the minimum expression:

#import <Foundation/Foundation.h>  @interface MyClass : NSObject  @end 

Both errors are reported on the @interface line, and they are: - missing @end - expected identifier or '{'

like image 239
Matias Masso Avatar asked Oct 26 '11 18:10

Matias Masso


1 Answers

Check the header files that are #imported on the same page, and verify that the headers have matching @interface/@end statements.

I had the same problem, and XCode reported that my .m file's @implementation had a missing @end statement, even when I pared it down to just:

#import "MasterViewController.h" #import "MyBadHeaderFile.h" @implementation MasterViewController @end 

In reality the bug was a missing @end from a #imported MyBadHeaderFile.h file.

like image 67
JasonD Avatar answered Sep 17 '22 15:09

JasonD