Re: iTunes-like outline view using core data?
Re: iTunes-like outline view using core data?
- Subject: Re: iTunes-like outline view using core data?
- From: "Carter R. Harrison" <email@hidden>
- Date: Mon, 6 Aug 2007 17:36:16 -0500
Ken,
Went ahead and followed your suggestion and everything is working
exactly how I would like it now. Instead of using bindings however,
I took the route of setting the array programmatically by using the
setContent:(id)content method of NSTreeController. Thanks again.
On Aug 5, 2007, at 6:52 PM, Ken Kania wrote:
I assume you are using a NSTreeController to supply your
NSOutlineView with data. The reason for your duplicate listing of
"header" and "child" cells is you misunderstand the behavior of
NSTreeController. As you have it now, NSTreeController fetches all
entities of type "abstractOutlineEntity" (which means both concrete
types in your case) to display as roots in your tree. Thus your
"My Cool Playlist" will already be shown as a root node. Then,
NSTreeController uses the child key that you provide then to
populate the subtree under each of these nodes, which results in
displaying "My Cool Playlist" again.
To fix this, you could specify a specific set or array of
"abstractOutlineEntity" to use as your content. Look under the
bindings panel in IB for your TreeController.
I'm trying to setup an iTunes-like outlineview with a core data
application. The goal is to have heading cells (like the
"Library", "Store", and "Playlist") that draw differently from
their contents in the tree. So far what I've tried to do is have
an abstract core data entity (we'll call it
"abstractOutlineEntity"). Then I have two concrete entities that
have "abstractOutlineEntity" as their parent object. In my nib
file, I have the outlineview set to hold "abstractOutlineEntity"
entities. As for the two concrete entities, one of them is
supposed to act as a heading cell in the outlineview, and the
other is supposed to act as a child cell. This seemed like the
logical way to do this - b/c the outlineview is set to hold
"abstractOutlineEntity" entities which my concrete entities are.
Now when my app launches I can correctly display the heading
cells, but when I try to create a child object using a custom
subclass, the child object appears correctly as a child in the
outlineview like it should, but it also appears a second time as a
root level object. I've tried to draw the resulting tree below
after trying to add a new child object. Does anybody have any
idea how to prevent this? Thanks in advance.
-Library (heading cell)
-Playlists (heading cell)
- My Cool Playlist (child cell)
-My Cool Playlist (appearing again as a heading cell - not what i
want)
Regards,
Carter
_______________________________________________
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
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