objective c - NSImage forward declaration error -


i'm trying convert nsurl nsimage when try following code:

nsurl *url = [nsurl urlwithstring:[myarray objectatindex:i]]; nsimage *myimage = [[nsimage alloc] initwithcontentsofurl:url]; 

xcode gives me error "receiver type 'nsimage' instance message forward declaration. according other posts, it's problem importing. however, i'm importing .h file coredata , i've tried using this:

#ifdef __objc__     #import <uikit/uikit.h>     #import <foundation/foundation.h>     #import <coredata/coredata.h> #endif 

from receiver type forward declaration. have no idea @ point, i'm sure it's obvious cannot figure out. header .m file is

#import "myclass.h" #import <foundation/foundation.h> 

and coredata being imported in .h file. thank you!

for mac, want appkit rather uikit.


Comments