I'm having class that inherits NSManagedObject
that was generated using my db model:
// .h
@interface Sketch : NSManagedObject
@property (nonatomic, retain) NSDate * added;
@property (nonatomic, retain) NSString * board;
@property (nonatomic, retain) NSString * filepath;
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSString * filename;
@end
// .m
@implementation Sketch
@dynamic added;
@dynamic board;
@dynamic filepath;
@dynamic title;
@dynamic filename;
@end
I'm using that class instances in UITableView
. Now I need to add some instances that are not stored in db (just to show them in the list):
Sketch sketch = [[Sketch alloc] init];
But when trying to set instance properties
sketch.title = @"test title";
I'm getting exception:
-[Sketch setTitle:]: unrecognized selector sent to instance 0x7ff112c13e30
Does it mean I have to create instance by adding them to Managed Context only (even if I'm not going to store them)?
[NSEntityDescription insertNewObjectForEntityForName:SKETCH_ENTITY
inManagedObjectContext:context];