Trying to bind to NSTreeController
Trying to bind to NSTreeController
- Subject: Trying to bind to NSTreeController
- From: Todd Blanchard <email@hidden>
- Date: Tue, 12 Jul 2005 21:41:55 -0700
I'm trying to create a custom binding to an
NSTreeController.arrangedObjects.someKey.
When registering for KVO on arrangedObjects.someKey I'm finding that
I'm only getting observations of type NSValueChanged (never
NSValueInserted or the other notification types) and the thing that
changed is some private TreeNodeProxy class or a private
NSTreeControllerProxy class. How is an individual supposed to handle
notifications of changes in private proxy objects that don't forward
valueForKeyPath: requests properly? Seems like that TreeNode class
needs to be made public.
Is there an example of binding an indexed property to a tree
controller's arrangedObjects.someKey anywhere?
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
{
int changeType = [[change objectForKey: NSKeyValueChangeKindKey]
intValue];
if(changeType == NSKeyValueChangeSetting) // this is the only
one that gets sent!
{
...
}
else if(changeType == NSKeyValueChangeInsertion)
{
//never gets here
}
else if(changeType == NSKeyValueChangeRemoval)
{
//never gets here
}
else if(changeType == NSKeyValueChangeReplacement)
{
//never gets here
}
}
_______________________________________________
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