views:

67

answers:

2

I am building a very simply Core Data + Core Animation application.

While compiling for OSX 10.6, 64 bits, Xcode keeps throwing the error:

/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequestExpression.h:16:0 
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequestExpression.h:16: 
 error: cannot find interface declaration for 'NSExpression', superclass of 'NSFetchRequestExpression'

If I compile at 10.5 everything would be fine. Also, I have started another empty project with bare minimal setting. Still, the problem remains. Anybody had this problem before? If you are not exactly sure, any guesses would be welcome too.

A: 

I think that there are just two possibilities: the file containing the declaration of the class NSExpression has not been imported because the relative directive is missing, or because the file is missing.
I would expect that you get an error, if a directive would make reference to a file that cannot be found.

kiamlaluno
+1  A: 

NSExpression is part of Foundation; Foundation, AppKit, and Core Data together are Cocoa. Thus, in order for the compiler to know about NSExpression, you need to have already imported <Foundation/Foundation.h> or <Cocoa/Cocoa.h>. I suggest doing this in your prefix header (which you should be doing already, assuming you didn't empty out or unset the prefix header that Xcode gives you for free).

Peter Hosey