Re: Xcode-like "Groups & Files" view: NSTreeController and/or core data?
Re: Xcode-like "Groups & Files" view: NSTreeController and/or core data?
- Subject: Re: Xcode-like "Groups & Files" view: NSTreeController and/or core data?
- From: douglas welton <email@hidden>
- Date: Mon, 12 Jan 2009 16:58:04 -0500
Hi Rick,
From my experience, I would suggest that you go the route of using
NSTreeController along with NSTreeNode. This made life much easier
for my heterogeneous dataset. NSTreeNode has a representedObject
attribute which you can use to "normalize" the heterogeneous nature of
your data.
Also, NSOutlineView has a delegate method:
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:
(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
which will allow you to customize the appearance of the cell
displaying a visual representation of your data.
Between the two of these, you should easily be able to accomplish your
goal.
regards,
douglas
On Jan 12, 2009, at 4:21 PM, Rick Hoge wrote:
I have a project in which it would be helpful to create an
organizational view for components of a project very similar to the
"Groups & Files" view in Xcode. My application would organize
pieces of data from a number of experimental sessions, and perform
pre-configured sequences of processing operations on these. The
datasets could be organized similar to how source code files are
done in Xcode, and the processing sequences would be displayed in a
way similar to targets and build phases in Xcode.
I have dabbled with NSTreeController/NSOutlineView as well as with
Core Data, and am trying to decide whether to use NSTreeController
or the older datasource/delegate approach to populate my outline
view. The thing that is tripping me up, conceptually, is that such
an outline view has to represent very different kinds of object -
ranging (in Xcode) from build phases to source code files. Do all
of these need to be subclasses of some node parent class? or would
you use a category? Also in Xcode there are numerous instances
where the same object is referenced at different points in the
outline view. This seems like it could get messy to me.
If anyone can suggest a design strategy that could work well for
grouping varied objects type in an NSOutlineView, similar to what's
used in Xcode, I'd be very grateful.
Thanks,
Rick
PS it's occurred to me that I could just *use* Xcode for the above
tasks, but I should really develop a dedicated interface ...
(43092.6825)
(43092.6825)
_______________________________________________
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