I donβt know if it is stupid or not, but I turn my head over it for about an hour or two.
I get the NSData object from NSUserDefaults and then convert it to UIImage . Now, how to install my CCSprite image on my UIImage?
spriteWithFile does not work here because it requires an NSString . I am looking for an API that has a UIImage parameter. Is it possible?
Any ideas?
Edit1 : How is it?
UIImage *image = [UIImage imageWithData:(NSData*)obj]; sprite = [CCSprite spriteWithCGImage:image.CGImage key:@"mainSprite"];
source share