Re: NSTreeController & NSOutlineView
Re: NSTreeController & NSOutlineView
- Subject: Re: NSTreeController & NSOutlineView
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 23 Jun 2005 22:36:33 -0700
On Jun 23, 2005, at 7:19 PM, Thaddeus Cooper wrote:
Like many other people I'm having some trouble with
NSTreeController and NSOutlineView. I have an array of data that is
modeled like this:
Roll
- number
- shots --->> Shots
Shots
- scene
- take
- etc.
[...]
I have an array controller that is being used for the TableView and
the data entry part of the interface. I added an NSOutlineView, and
instantiated an NSTreeController. The NSTreeController is connected
to the file's MOC, it is set to entity, and the Entity Name is set
to Roll. I also checked Automatically prepares content since that
is what I noticed in the ArrayController attributes. Then I'm
confused. I've tried hooking up the data source in the attributes
pane to the NSTreeController, hooking up to the contentSet, and
contentArray.
If you simply want to list all the Rolls, then for the tree
controller you shouldn't have to do anything more than check
"Automatically prepares content" (assuming they're being added to the
same managed object context as the table view array controller --
assuming in turn it's responsible for adding new Rolls?). You
specify the Entity for the tree controller, and the "Children key
path" (which in this case will be 'shots').
Ensure that you disable the "Raises for non-applicable keys" option
for the table column's value binding.
If you want to be able to add Shots using the tree controller, you
will have to create a subclass of NSTreeController and override the
addChild:.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden