Is NSTableView sortDescriptors KVO compliant?
Is NSTableView sortDescriptors KVO compliant?
- Subject: Is NSTableView sortDescriptors KVO compliant?
- From: Adhamh Findlay <email@hidden>
- Date: Thu, 13 Dec 2007 20:21:57 -0600
Hello,
I have an NSTableView subclass and I want to use KVO to detect when
the sort descriptors change so that I can save them. The idea is
that when the user comes back to the table the columns will be sorted
the same way they last saw them.
Here's the addObserver call:
[self addObserver: self forKeyPath: @"tableView.selectionIndexes"
options:NSKeyValueObservingOptionNew context:self];
[self addObserver: self forKeyPath: @"tableView.sortDescriptors"
options:NSKeyValueObservingOptionNew context:self];
For testing here's my observeValueWithKeyPath method:
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)
object change:(NSDictionary *)change context:(void *)context;
{
NSLog(keyPath);
}
In the log see "selectionIndexes" but I never see "sortDescriptors".
This leads me to believe that sortDescriptors is not KVO compliant,
but its listed in the bindings reference for NSTableView http://
developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/
BindingsText/NSTableView.html
Adhamh
_______________________________________________
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