• 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
Re: Undo in conjunction with core data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undo in conjunction with core data


  • Subject: Re: Undo in conjunction with core data
  • From: Kyle Sluder <email@hidden>
  • Date: Sat, 22 Jan 2011 17:49:49 -0800

On Jan 22, 2011, at 5:34 PM, Kenneth Baxter <email@hidden> wrote:

> Thanks Dave. I am now trying to use an array controller. I have set up the array controller and an observer on arrangedObjects, and that gets called during my addition and removal of children, but the change kind is always 1, and there is never anything in the old or new value arrays, so nothing beyond this knows whether it was an insertion or a deletion. I'm not sure exactly how much use that is in managing my other objects.

This is because of the aforementioned naughtiness of NSObjectController and friends. Since they ignore the options you pass to -addObserver:forKeyPath:options:context:, you will never get the old and new values even if you ask for them by providing NSKeyValueObservingOptionNew or NSKeyValueObservingOptionOld.

As mentioned before, for the same reason you can't use NSKeyValueObservingOptionPrior to work around this.

See also: http://homepage.mac.com/mmalc/CocoaExamples/controllers.html (specifically, the section titled "(Missing) KVO Notification Old and New Values").

--Kyle Sluder
(sent from the road)
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Undo in conjunction with core data (From: Kenneth Baxter <email@hidden>)

  • Prev by Date: Re: Undo in conjunction with core data
  • Next by Date: Re: Undo in conjunction with core data
  • Previous by thread: Re: Undo in conjunction with core data
  • Next by thread: Re: Undo in conjunction with core data
  • Index(es):
    • Date
    • Thread