NSTreeController, NSOutlineView + Core Data
NSTreeController, NSOutlineView + Core Data
- Subject: NSTreeController, NSOutlineView + Core Data
- From: Alex Reynolds <email@hidden>
- Date: Wed, 5 Apr 2006 23:20:30 -0400
I have multiple entities in a Core Data model from which I would like
to build a hierarchy in NSOutlineView.
From the root leaves, I have one set of data from one entity; two
levels down, separate entities representing data of the type
represented by each parent node, e.g.:
Type A
|---------> Data of Type A
|---------> Data of Type A
|
Type B
|---------> Data of Type B
| |
| |----------> Data of Subtype of B
|---------> Data of Type B
| |
| |----------> Data of Subtype of B
|
etc.
Since I can't hook up a single binding (i.e. one entity) to the
NSOutlineView -- or I don't know how to build the above structure
from a single binding -- I've subclassed NSTreeController and
NSOutlineView so that I can try to build this kind of custom
structure into an array which I feed into the NSTreeController, which
I hope should in turn be displayed by NSOutlineView.
So I have a couple questions:
1. Is this a bad way to approach handling multiple Core Data entities
with an NSOutlineView object? Is there an easier way?
2. Are there any code samples that provide a simple demonstration of
how NSOutlineView and NSTreeController work together?
Thanks for any tips,
Regards,
Alex
_______________________________________________
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