• 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
NSTreeNode mutableChildNodes documented as observable using key-value observing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTreeNode mutableChildNodes documented as observable using key-value observing


  • Subject: NSTreeNode mutableChildNodes documented as observable using key-value observing
  • From: "email@hidden" <email@hidden>
  • Date: Fri, 11 Feb 2011 14:14:24 +0000

The docs for  NSTreeNode -mutableChildNodes states:

"The array that is returned is observable using key-value observing."

This doesn't seem to make any sense nor does it seem to be true.

What does seem to be true is that NSTreeNode - childNodes is observable using key-value observing.
When -mutableChildNodes is mutated a KVO notification is raised for childNodes.

An NSTreeNode instance can therefore observe its childNodes with:

[self addObserver:self forKeyPath:@"childNodes" options:0 context:someContext];

Sorting the node children using NSTreeNode -sortWithSortDescriptors also generates a KVO notification on  the childNodes path.

I would seem then that childNodes can be observed to provide the same sort of binding behaviour as NSArrayController - arrangedObjects.

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com







_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Performing the selector from a stored IMP
  • Next by Date: Re: Strange problem drawing a custom grid in NSTableView
  • Previous by thread: Re: Performing the selector from a stored IMP
  • Next by thread: Carbon overlay window in place of a cocoa view
  • Index(es):
    • Date
    • Thread