Hi, the problem I am trying to solve in an application that is using Core Data is to be able to hold a calculated value in a NSManagedObject custom ivar. The calculated value that I want to store is in fact an image. I do not want to persist these images; I build them and destroy them throughout the lifetime of the application. I tried along the lines of:
@interface RTStaffImage : NSManagedObject {
UIImage *image;
}
// Custom properties
@property (nonatomic, retain) UIImage *image;
// Managed object properties
@property (nonatomic, retain) NSNumber *imageID;
@property (nonatomic, retain) NSString *imageName;
and custom accessors methods:
- (void)setImage (UIImage*)im;
- (UIImage *)image;
and in the implementation:
@implementation RTStaffImage
@synthesize image;
@dynamic imageID;
@dynamic imageName;
This fails at runtime with unrecognised selector problems:
-[NSManagedObject setImage:]: unrecognized selector sent to instance
The above approach is what Apple (or, at least as far as I see having read the docs) outlines for transient properties so it should work :-(
Any ideas, comments?