Re: NSCollectionView - getting notified of selection change?
Re: NSCollectionView - getting notified of selection change?
- Subject: Re: NSCollectionView - getting notified of selection change?
- From: Graham Cox <email@hidden>
- Date: Mon, 13 Oct 2008 21:02:55 +1100
On 13 Oct 2008, at 7:23 pm, Nathan Kinsinger wrote:
On Oct 13, 2008, at 1:26 AM, Graham Cox wrote:
The title says it all really - is there a way to get notified about
selection changes in a NSCollectionView? The docs appear to
indicate that this is not possible, but that seems to be a very
obvious need, so it's surprising.
tia,
Graham
The documentation for NSCollectionView selectionIndexes
"This property is observable using key-value observing."
http://developer.apple.com/documentation/Cocoa/Reference/NSCollectionView_Class/Introduction/Introduction.html#/
/apple_ref/occ/instm/NSCollectionView/selectionIndexes
Yes, I saw that, but I can't get it to work, since I'm just not seeing
how NSIndexSet is KVC compliant, nor how NSCollectionView is KVC
compliant for that property. I'm obviously missing some facet of KVO
here, since using KVO in more conventional circumstances works OK for
me.
I have:
[mPickerView addObserver:self forKeyPath:@"selectionIndexes"
options:NSKeyValueObservingOptionNew context:NULL];
but my observer is never notified. The keyPath is obviously wrong, but
I can't figure out what it's meant to be. It's not even clear if the
"selection" is considered a to-one or a to-many relationship here. But
in any case this property doesn't appear to fit any of the criteria
listed for KVC compliance:
http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Compliant.html#/
/apple_ref/doc/uid/20002172
So... huh? I'm sure I'm being dense but I'm not getting something here.
Graham
_______________________________________________
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