• 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
Trying to bind to NSTreeController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Trying to bind to NSTreeController
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: Basic bindings questions
  • Next by Date: Path of a folder represented in AppleScript path style
  • Previous by thread: Re: NSMenuItem attributed title size discrepancy
  • Next by thread: Re: Trying to bind to NSTreeController
  • Index(es):
    • Date
    • Thread