On Aug 22, 2014, at 4:31 PM, Luc Van Bogaert <luc.van.boga...@me.com> wrote:

> I'm puzzled by a problem that I am seeing with key value observing an 
> arraycontroller and I'm hoping that someone here could shed some light.

> I've tried observing other arraycontroller properties, such as 
> 'selectionIndexes' or 'selectedObjects', and the document gets all the 
> notifications, but 'new' as well as 'old' value in the change dictionary are 
> always 'null', even though I can get a hold of the selected object using 
> '[object selectedObjects]'. So why is this object not in the change 
> dictionary? 

This is a long-standing issue with array controllers.  The KVO change 
notifications never include the new or old values, regardless of the KVO 
options to request them.  You just have to query the object via the key path to 
get the new value.  If you request NSKeyValueObservingOptionPrior, you can get 
the old value at the time that fires.

Regards,
Ken


_______________________________________________

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

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

Reply via email to