• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iTunes-like outline view using core data?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iTunes-like outline view using core data?


  • Subject: Re: iTunes-like outline view using core data?
  • From: Ken Kania <email@hidden>
  • Date: Sun, 05 Aug 2007 16:52:05 -0700

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:
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


  • Follow-Ups:
    • Re: iTunes-like outline view using core data?
      • From: "Carter R. Harrison" <email@hidden>
References: 
 >iTunes-like outline view using core data? (From: "Carter R. Harrison" <email@hidden>)

  • Prev by Date: Re: Drag with NSTableview
  • Next by Date: Control doesn't stay centered?
  • Previous by thread: Re: iTunes-like outline view using core data?
  • Next by thread: Re: iTunes-like outline view using core data?
  • Index(es):
    • Date
    • Thread