• 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
When to remove observers in Core Data without breaking changes after an undo.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

When to remove observers in Core Data without breaking changes after an undo.


  • Subject: When to remove observers in Core Data without breaking changes after an undo.
  • From: "Ian G. Gillespie" <email@hidden>
  • Date: Wed, 16 Nov 2005 08:20:29 -0500

I tried searching for an answer to this issue I haven't had much luck: Lets say I have a to-many relationships setup like the ubiquitous Department to Employees example, where each Department wants to know when changes are made to an Employee's salary (much like the example here, http://developer.apple.com/documentation/Cocoa/ Conceptual/CoreData/Articles/cdFAQ.html#//apple_ref/doc/uid/ TP40001802-DontLinkElementID_13 )

If I register each Department for changes to an Employee's salary in the -(void)addEmployeesObject:(id)employee method then I want to remove the observers in -(void)removeEmployeesObject:(id)emp. This all works fine until the user removes an employee and then performs an undo, at this point the employee is re-inserted but if the user makes a change to the salary attribute the Department is no longer observing for changes.

So where is it best to remove observers without crippling undo functioning?

Any help would be greatly appreciated.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: changing of color /font of items in a column of NSBrowser
  • Next by Date: NSBorderlessWindowMask and WebView
  • Previous by thread: Re: changing of color /font of items in a column of NSBrowser
  • Next by thread: NSBorderlessWindowMask and WebView
  • Index(es):
    • Date
    • Thread