You did not import the #import header file ...
When compiling for iOS and OsX, I had a similar problem that I solved by importing TargetConditionals.h. The last thing is as follows:
#import <TargetConditionals.h> #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #import <UIKit/UIKit.h> #elif TARGET_OS_MAC #import <Cocoa/Cocoa.h> #endif @interface MyClass : NSObject #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE // Define UIKit methods #elif TARGET_OS_MAC // Define Cocoa methods #endif - (void)reloadRegisteredComponents; @end
source share