Re: Another NSTreeController/NSOutlineView/NSIndexPath Question
Re: Another NSTreeController/NSOutlineView/NSIndexPath Question
- Subject: Re: Another NSTreeController/NSOutlineView/NSIndexPath Question
- From: Gordon Apple <email@hidden>
- Date: Fri, 12 Jun 2015 14:36:38 -0500
- Thread-topic: Another NSTreeController/NSOutlineView/NSIndexPath Question
Ok, I admit to being confused. Seems like what we are missing is the data
model. Your containers must be or at least have an array for storage.
Normally, the NSTreeController reflects this model and has the info provided
to traverse it. In my case, elements are CoreData objects with parent
relationships. This makes it a lot easier to trace index paths, i.e., you
don¹t have to search the entire tree to find something. My objects have a
recursive method, ³indexPathOfObject:² which will allow you to find the
index path of any object. Top level object also has ³objectAtIndexPath:²
which allows you to find an object in the tree. The NSTreeController has
NSArrayControllers, not arrays. It depends on your own data model arrays. Is
there any way you can add the parent paths and the mentioned methods to
objects in your data model?
On 6/12/15 8:22 AM, "email@hidden"
<email@hidden> wrote:
> I don¹t think you understood the question or you don¹t understand how
> NSTreeController works. Yes, inside the Tree Controller it is stored as
> array¹s of array's, but to add nodes to the tree, it doesn¹t matter how they
> are stored, my question is how to find a place in the tree (iow, the Index
> Path) in which to add a node. I have a flat list, but there is nothing
> stopping me adding this to the tree however I like (except that I¹m not sure
> how to form the Index Path, which is why I posted). I just want to know if the
> ³ContentArray² can be used to do this or if I have to use the Tree Controller
> Selection methods? There really needs to be more/better documentation on this.
_______________________________________________
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