On Apr 22, 2009, at 10:45 AM, jonat...@mugginsoft.com 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to