开发者

Which methods are good to override when creating custom NSManagedObject subclasses?

开发者 https://www.devze.com 2023-01-02 08:40 出处:网络
The Core Data Programming Guide talks a lot about what not to override. So the question is: What is good to override?

The Core Data Programming Guide talks a lot about what not to override. So the question is: What is good to override?

Like I see it, I c开发者_开发问答an't override -init or -initWithEntity:insertIntoManagedObjectContext:

So where else would be a good override point to set up some basic stuff? Or is it generally not needed to do custom initialization? Does the whole thing rely only on accessing properties which then start to do fancy things? So no custom initializations?


I often override the following methods:

-(void) awakeFromFetch
-(void) awakeFromInsert
-(void) willTurnIntoFault
-(void) didTurnIntoFault

Don't forget to call super implementations. In Addition the following method should be overridden to process Objects after undo/redo

- (void)awakeFromSnapshotEvents:(NSSnapshotEventType)flags

ADC

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号