• 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
NSOutline and NSTreeController using bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSOutline and NSTreeController using bindings
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: How did gcc handle synthesized atomic vs custom nonatomic setter/getter?
  • Next by Date: [Q] How to handle mouseDown when PDFView is in full screen mode?
  • Previous by thread: Re: How did gcc handle synthesized atomic vs custom nonatomic setter/getter?
  • Next by thread: Re: NSOutline and NSTreeController using bindings
  • Index(es):
    • Date
    • Thread