• 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: Problem implementing keyPathsForvaluesAffecting<Key>
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem implementing keyPathsForvaluesAffecting<Key>


  • Subject: Re: Problem implementing keyPathsForvaluesAffecting<Key>
  • From: "email@hidden" <email@hidden>
  • Date: Fri, 24 Apr 2009 09:20:30 +0100


On 23 Apr 2009, at 23:21, Jim Correia wrote:

On Apr 22, 2009, at 10:45 AM, email@hidden wrote:

The property canDelete is dependent on three other properties as shown below.

Is there a problem with my implementation of + keyPathsForValuesAffectingCanDelete with regard to the key path @"arrayController.canRemove"?

Is is a relatively well known issue that NSKeyValueObservingOptionNew and NSKeyValueObservingOptionOld do not work with controller properties. See:


	http://homepage.mac.com/mmalc/CocoaExamples/controllers.html

What is perhaps less well known is that controller keys which don't support the New/Old KVO observing options also don't support NSKeyValueObservingOptionPrior.

The +keyPathsForValuesAffecting<Key> mechanism relies on NSKeyValueObservingOptionPrior in order to do its magic.

Until such time as controller keys correctly support the KVO observing options, you can't

a) rely on Old/New/Prior in your own observers
b) use a controller property as part of a key path in +keyPathsForValuesAffecting<Key>


- Jim


Thanks for pointing out why this is broken.
Presumably this has been radared to death.

Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




_______________________________________________

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: 
 >Problem implementing keyPathsForvaluesAffecting<Key> (From: "email@hidden" <email@hidden>)
 >Re: Problem implementing keyPathsForvaluesAffecting<Key> (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: CF autorelease?
  • Next by Date: How to clone a mutable dictionary
  • Previous by thread: Re: Problem implementing keyPathsForvaluesAffecting<Key>
  • Next by thread: Bindings making NSNumberFormatter strange
  • Index(es):
    • Date
    • Thread