• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trying to bind to NSTreeController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to bind to NSTreeController


  • Subject: Re: Trying to bind to NSTreeController
  • From: Scott Anguish <email@hidden>
  • Date: Wed, 13 Jul 2005 02:39:12 -0400


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
  • Follow-Ups:
    • Re: Trying to bind to NSTreeController
      • From: Todd Blanchard <email@hidden>
References: 
 >Trying to bind to NSTreeController (From: Todd Blanchard <email@hidden>)

  • Prev by Date: Re: How to embed a file into my project
  • Next by Date: Re: detecting scrolling in webView
  • Previous by thread: Trying to bind to NSTreeController
  • Next by thread: Re: Trying to bind to NSTreeController
  • Index(es):
    • Date
    • Thread