Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Source list tree nodes able to represent different entities



Hi,

I'm working on a core data application that has a UI similar to iTunes:

- NSOutlineView as source list with groups on the left
- NSTableView to display the actual content on the right

Just as in iTunes I now want to display properties of different object classes in that NSTableView, depending on what the user selects in the source list tree. When you select "Podcasts" in iTunes' source list you are obviously presented with instances of the "podcast" class and not the "song" class.

Example:

BOOKS-GROUP
   Book A             ->   Chapters of Book A shown in table
   Book B             ->   Chapters of Book B shown in table
   Book C             ->   Chapters of Book C shown in table

MAGAZINES-GROUP
   Magazine 1     ->   Articles of Magazine 1 shown in table
   Magazine 2     ->   Articles of Magazine 2 shown in table
   Magazine 3     ->   Articles of Magazine 3 shown in table


I started designing my data model by creating a TreeNode entity that can be used to form my entire source list tree. These have a "representedObject" to-one relationship to point to the actual container object (book or magazine) that contains the items (chapters or articles) shown in the table.


But I don't know how to work around the fact that a relationship like my TreeNodes "representedObject" wants a single entity it relates to. I want it to relate to more than one entity!

Unfortunately, the usual example-suspects (CoreRecipies, SourceList Sample) seem to work with only one entity/class.


So does anyone know how to implement a source list tree that points to objects of different entities? Any help is greatly appreciated!! Thanks.



Sebastian _______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.