Re: problem observing selectionIndex of an array controller
Re: problem observing selectionIndex of an array controller
- Subject: Re: problem observing selectionIndex of an array controller
- From: Ken Thomases <email@hidden>
- Date: Sun, 8 Mar 2009 03:10:42 -0500
On Mar 8, 2009, at 1:52 AM, Stuart Malin wrote:
I'm trying to watch for changes in the selection of a tableView
managed by an NSArrayController. I set up an observer:
[mArrayController addObserver:self
forKeyPath:@"selectionIndex"
options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew
context:NULL];
When the -observedValueForKeyPath:... method is invoked, the change
dictionary has entries for the new and old value, but they are both
NSNull.
According to the NSArrayController docs, the selectionIndex is an
observable property. Why might I not be getting the index values?
Known bug. Search for "(Missing) KVO notification old and new values"
at this page: http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
You'll have to query the property for the new value and keep track of
any old value yourself.
Regards,
Ken
_______________________________________________
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