Re: OutlineView, bindings and array of NSDictionaries.
Re: OutlineView, bindings and array of NSDictionaries.
- Subject: Re: OutlineView, bindings and array of NSDictionaries.
- From: Sandro Noel <email@hidden>
- Date: Mon, 17 Nov 2008 23:24:58 -0500
Thank you Quincey,
Very nice explanation i'll adjust my code.
Sandro Noel.
On 17-Nov-08, at 6:45 PM, Quincey Morris wrote:
On Nov 17, 2008, at 13:51, Sandro Noel wrote:
I cant seem to get my data to display properly in the Outline View,
and i am sure it is because of the organisation of my data
See here:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTreeController_Class/Reference/Reference.html
(the overview), and here:
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/CntrlContent.html#/
/apple_ref/doc/uid/TP40002147-185041
You're basically going to need an additional set of objects that
represent the servers, each of which has an array of volumes. The
trick is making sure that they all properly respond to the
"children", "countOfChildren" and "isLeaf" property names that you
specify to the tree controller.
In the simplest case, you just just need a "children" property:
Dictionary 0
serverName = Server1
VolumeName = @""
children = {Dictionary 1, Dictionary 2, Dictionary 3}
Dictionary 1
serverName = Server1
VolumeName = Volume1
children = {}
Dictionary 2
serverName = Server1
VolumeName = Volume2
children = {}
Dictionary 3
serverName = Server1
VolumeName = Volume3
children = {}
and then bind either the server dictionary as the content object for
the tree controller or (if there are multiple servers) an array of
server dictionaries as the content array.
_______________________________________________
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
_______________________________________________
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