开发者

Cannot find NSExpression while compiling for OSX 10.6

开发者 https://www.devze.com 2022-12-14 13:00 出处:网络
I am building a very simply Core Data + Core Animation application. While compiling for OSX 10.6, 64 bits, Xcode keeps throwing the error:

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 se开发者_如何学Ctting. Still, the problem remains. Anybody had this problem before? If you are not exactly sure, any guesses would be welcome too.


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).


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消