Re: Problem implementing keyPathsForvaluesAffecting<Key>
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