Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
WORKAROUND: observing changes in an NSArrayController's selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WORKAROUND: observing changes in an NSArrayController's selection



I ended up simply querying the array controller for the desired key directly, like this:

[myArrayController valueForKeyPath:@"selection.myKey"];

My earlier mail was not quite correct. The following message expression is what always returns NSNull:

[change valueForKey:NSKeyValueChangeNewKey];

Never did figure out why this is.

Chuck

Chuck Musser wrote:

When I use KVO to observe my NSArrayController's selection, my observeValueForKeyPath: ofObject: change: context: method gets called, but the contents of the "change" parameter are not what I expect. This dictionary contains "kind" and "new" keys, but the value associated with the "new" key is always NSNull.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >observing changes in an NSArrayController's selection (From: Chuck Musser <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.