• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[CORE DATA] Reinitializing NSManagedObject after redo?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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
  • Prev by Date: Re: Attributed string not displaying with effects of attributes in an NSTextView...
  • Next by Date: Re: When exactly does a fault get fired?
  • Previous by thread: Re: Attributed string not displaying with effects of attributes in an NSTextView...
  • Next by thread: Horrible documentation
  • Index(es):
    • Date
    • Thread