Question

I keep on getting this error "error: expected specifier-qualifier-list for core data code im working with, in the app delegate.

Now when i get this error and about 40 other errors relating to managedobjectcontext etc, i thought maybe the library needs to be imported. Now i havent done this before, but i went to Frameworks group and add existing frameworks and it added CoreData.framework. I re-build and it still came up with the error. Do I need to import anything in the headers explicitly or is there some other step i need to do?

Thanks

Was it helpful?

Solution

You're right, but it's...

#import <CoreData/CoreData.h>

OTHER TIPS

Can you specify the exact error? The bit after "for" is probably the important part.

The error expected specifier-qualifier-list... indicates that you've tried to use an undefined data type in a member declaration, either in a class or a struct. You need to #import the specific header where the missing type is defined. To find out which header contains the missing type, Command-double-click on the type name to open the header in which it's defined. Next, hold down the Command key and click on the title of the window to see the header's full path. For example, command-double-clicking on "NSImage" opens up the NSImage.h file, and command-clicking the title shows that it's in AppKit.framework. So the import statement for this header would be #import <AppKit/NSImage.h>.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top