Re: Displaying multiple core data relationships in NSOutlineView
Re: Displaying multiple core data relationships in NSOutlineView
- Subject: Re: Displaying multiple core data relationships in NSOutlineView
- From: Rick Hoge <email@hidden>
- Date: Sat, 17 Jan 2009 11:19:25 -0500
Steve, Quincy: Thank you for the replies!
At the moment I'm working with a non-Core-Data class to achieve the
outline view, using code adapted from the SourceView example. I am
realizing that to be able to archive this and correctly maintain
object graphs, I'll likely have to link the outlined objects to a Core
Data model but have finally resigned myself to the fact that Core Data
won't facilitate display in an Outline View. Bindings can spoil you,
then you try to do that one thing that isn't straightforward and
actually takes code...
Cheers,
Rick
The design I'm trying to achieve is analogous to the way Xcode
displays a "Targets" group and a "Bookmarks" group in the same
outline view. If Core Data was used for this (and I don't know if
it was), it seems clear that Targets and Bookmarks would be
modeled as separate to- many relationships and entities, and yet
they are nicely displayed in the same outline view.
I had to do something a bit more complex than what you want to do: I
wanted to summarize results of large numbers of objects into an
outline view for a report. In the end I had to create my own
hierarchy of summary objects and display them -- which makes sense
now but was frustrating realizing that I wouldn't be able to do it
with judicious filtering and @summing the raw Core Data objects.
You could do the same but your case may be simpler. One possibility
would be to make your entities in question descend from a single
super class. That super class would only need the outline stuff
(parent, children, isLeaf...) and whatever you want to display in
the outline, perhaps 'name' (note: avoid calling an attribute
'description' -- binding issues...). Then, I think, you could hack
a way to show the whole lot by binding your outline to the super
class.
Cheers,
Steve
(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