I am not sure whether using transient attribute is the correct way for my situation. I am getting kind of feeds from server and stores in the core data. Am showing all these feeds in a TableView. There are many types of feeds, so cell layout and subviews vary with each feed. In some feeds, I need to set a temporary variable (BOOL and Integer. So NSNumber I know). The use case is, user should be able to enlarge and collapse some of the cells (A kind of "Read more.." link). So this state, I need to keep with each feed(NSManagedObject) object. This state will be there till app is running. It should not be saved to persistence storage because when user opens the app, all feed should be fresh.
I just added attribute with transient but it seems not working. I added 'NSNumber selected' attribute in entity as transient and added property and @dynamic in NSManagedObject file. I searched the forum and no solution is matching with mine. I tried with many sample stuffs but it really confusing..
Interface file is,
@interface FeedItemBase : NSManagedObject {
@private
}
@property (nonatomic, retain) NSDate * timestamp;
@property (nonatomic, retain) NSString * type;
@property (nonatomic, retain) NSNumber * premium;
@property (nonatomic, retain) NSNumber *selected; //This is what I added
@end
Implementation file is,
@implementation FeedItemBase
@dynamic timestamp;
@dynamic type;
@dynamic premium;
@dynamic selected; //This is what I added
@end
So please help me on this.