• 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: Jim Correia <email@hidden>
  • Date: Thu, 23 Apr 2009 18:21:40 -0400

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
_______________________________________________

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


  • Follow-Ups:
    • Re: Problem implementing keyPathsForvaluesAffecting<Key>
      • From: "email@hidden" <email@hidden>
References: 
 >Problem implementing keyPathsForvaluesAffecting<Key> (From: "email@hidden" <email@hidden>)

  • Prev by Date: custom field editor results in no focus ring
  • Next by Date: XCode Debugger Summary Format
  • Previous by thread: Re: Problem implementing keyPathsForvaluesAffecting<Key>
  • Next by thread: Re: Problem implementing keyPathsForvaluesAffecting<Key>
  • Index(es):
    • Date
    • Thread