NSTreeNode mutableChildNodes documented as observable using key-value observing
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