NSOutline and NSTreeController using bindings
NSOutline and NSTreeController using bindings
- Subject: NSOutline and NSTreeController using bindings
- From: Hrishikesh Murukkathampoondi <email@hidden>
- Date: Mon, 11 Oct 2010 00:25:18 +0530
I am trying to understand how NSOutlineView and NSTreeController can be used in conjunction (with bindings). In most examples the NSTreeController's "Content Array" binding is pointed to a mutable array that has a specific format (like below).
[theList addObject:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], @"isGroup",
@"Department", @"name",
[NSArray arrayWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Science", @"name",
nil],
[NSDictionary dictionaryWithObjectsAndKeys:
@"Art", @"name",
nil],
[NSDictionary dictionaryWithObjectsAndKeys:
@"History", @"name",
nil],
nil], @"children",
nil]];
There are the following additional bindings that are done:
NSOutlineView bindings -
1. "Content" bound to NSTreeController's "arrangedObjects"
2. "Selection Index Paths: to NSTreeController's "selectionIndexPaths"
NSTableColumn bindings:
3. "Value" is bound to arrangedObjects.name
I have read the class reference for NSTreeController and NSOutlineView but I still dont understand how the above works. Foe example, how does the NSOutlineView know which values are leaves?
NSOutlineView class ref document describes how to implement the data source if using conventional data sources. How does it work with bindings?
The above "special" format for the contents array is not discussed any where.
Please point me in the right direction.
Thanks
Hrishi
_______________________________________________
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