Re: Trying to bind to NSTreeController
Re: Trying to bind to NSTreeController
- Subject: Re: Trying to bind to NSTreeController
- From: Todd Blanchard <email@hidden>
- Date: Wed, 13 Jul 2005 22:53:44 -0700
So you're telling me the binding/KVO protocol between
NSTreeController and NSOutlineView is completely private and there is
no way to do a custom subclass of either without serious reverse
engineering?
Not cool.
Adios NSTreeController - Hello TBOutlineController (written under
10.3 - not a subclass of NSTreeController). It's more flexible and I
can make it do what I want.
Keeping this stuff secret isn't helping anybody. Nobody will use it
if they can't customize it.
On Jul 12, 2005, at 11:39 PM, Scott Anguish wrote:
NSTreeController's arrangedObjects is opaque.
From the updated reference doc that'll be out shortly.
Returns an object containing the receiver’s sorted content objects.
This is an opaque root node representing all the currently
displayed objects. This method should be used for binding, no
assumption should be made about what methods this object supports.
On Jul 13, 2005, at 12:41 AM, Todd Blanchard wrote:
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
_______________________________________________
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