NSTreeController selection/selectionIndexPath
NSTreeController selection/selectionIndexPath
- Subject: NSTreeController selection/selectionIndexPath
- From: Scott Ellsworth <email@hidden>
- Date: Tue, 21 Mar 2006 17:16:13 -0800
Is there a known problem with KVO on an NSTreeController's
selectionIndexPath binding? I googled and did not find one, but I
may have missed a key post.
My app has an NSOutlineView whose content comes from an
NSTreeController. (Specifically, the content of the NSOutlineView is
bound to the NSTreeController's arrangedObjects array, and the
NSTreeController's contentArray is bound to a key in my
NSWindowController that meets the node requirements.)
The items in the tree are displaying just fine, but when I click on
different items in the NSOutlineView, I never get notified that
anything has changed.
In awakeFromNib in my NSWindowController, I have:
NSLog(@"sc: %@ %@, %@",sectorController, [sectorController
selection], [sectorController selectedObjects]);
[sectorController addObserver:self forKeyPath:@"selection"
options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld
context:NULL];
[sectorController addObserver:self forKeyPath:@"selectedObjects"
options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld
context:NULL];
[sectorController addObserver:self forKeyPath:@"selectionIndexPath"
options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld
context:NULL];
In the same class, I have:
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)
object change:(NSDictionary *)change context:(void *)context{
NSLog(@"oVFKP:%@ is now %@ with dict %@",keyPath,object,change);
[super observeValueForKeyPath:keyPath ofObject:object change:change
context:context];
}
I have looked through a lot of previous posts, and while they discuss
a variety of interesting behaviors of NSTreeController, I am not
seeing this one mentioned. What have I missed?
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden