views:

14

answers:

1

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

Like I see it, I can't overwrite -init or -initWithEntity:insertIntoManagedObjectContext:

So where else would be a good overwrite 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?

+1  A: 

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

Martin Brugger
Interesting. So -awakeFromSnapshotEvents: is called every time when an undo/redo happens? Is that a "snapshot event"? (makes sense, almost)
dontWatchMyProfile
exactly, a list of possible events can be found in the apple developer documentation
Martin Brugger