[CORE DATA] Reinitializing NSManagedObject after redo?
[CORE DATA] Reinitializing NSManagedObject after redo?
- Subject: [CORE DATA] Reinitializing NSManagedObject after redo?
- From: Joshua Scott Emmons <email@hidden>
- Date: Fri, 17 Feb 2006 21:09:52 -0600
In my program, I insert NSManagedObject subclasses into the to-many
relationship of another managed object. When I undo, those subclasses
are removed from the to-many relationship, one by one. When I redo,
they are added back again. This is what I would expect.
But then I added some custom ivars to my object. Following the
documentation, I used the designated initializer -
initWithEntity:insertIntoManagedObjectContext: to set up and retain
these ivars and used -didTurnIntoFault to release them.
The problem is: when I undo the insertion of MyManagedObject, -
didTurnIntoFault fires, freeing my ivars. But when I redo the
insertion, -initWithEntity:insertIntoManagedObjectContext: DOES NOT
fire, so all of my ivars are nil!
Is there any method that fires when a managed object is inserted back
into a relationship because of a redo? -awakeFromInsert doesn't.
Neither does -awakeFromFetch. How am I supposed to reinitialize the
things destroyed by -didTurnIntoFault?
*scratches head
-Joshua Emmons
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden