receiver type *** for instance message is a forward declaration

后端 未结 9 1015
心在旅途
心在旅途 2021-01-30 01:19

In my iOS5 app, I have NSObject States class, and trying to init it:

states = [states init];

here is init

9条回答
  •  离开以前
    2021-01-30 01:45

    FWIW, I got this error when I was implementing core data in to an existing project. It turned out I forgot to link CoreData.h to my project. I had already added the CoreData framework to my project but solved the issue by linking to the framework in my pre-compiled header just like Apple's templates do:

    #import 
    
    #ifndef __IPHONE_5_0
    #warning "This project uses features only available in iOS SDK 5.0 and later."
    #endif
    
    #ifdef __OBJC__
        #import 
        #import 
        #import 
    #endif
    

提交回复
热议问题