I want to hold my heirarchy... And references.. So i don't want to change. I am working on a node wrapper.

Scott

On May 25, 2009, at 11:28 AM, Shlok Datye wrote:

I recently came across some nice sample code on how to use NSTreeController with Core Data. Here it is:

http://espresso-served-here.com/2008/05/13/nstreecontroller-and-core-data-sorted/

However, it takes route 2 on your list; the entities have "children" and "parent" relationships.

Shlok Datye
Coding Turtle
http://codingturtle.com


On 25.05.2009, at 17:38, Scott Andrew wrote:

I am working on a CoreData project but want some advice on using an Outline View.

My relationships are setup like so. They don't have a parent/child entry. The entries more match the read data.


Project
// just a simple group node will say (targets/sources) in localized languges.
        TargetGroup (one to one to TargetGroup)
        SourceGroup (one to one to SourceGroup)

TargetGroup
        Targets (one to may to targets)

SourceGroup
        Sources(one to many to sources).

Sources
        Language
        Entries (one to many to entries)
        Target  (one to many to targets)

Tragets
        Sources (one to many to sources)
        

I know i have a few options.

1.) Create a generic NSTreeNode subclass the does the right thing based on node type and gets the proper children,parent,etc...
2.) Change my model to a generic children/prarent node type.
3.) Subclass NSManagedObject to do the right thing based on type.
4.) Create a protocol that each object must override to give the proper data.
5.) Use a data source.

I think what makes this tricky is that this isn't just a simple one to one relationship and is what is throwing me off. I am leaning towards 1 and 3. I would like to keep this model due to the fact that it represents the real data. I may also be over thinking this a bit.. Any advice would be appreciated.

Scott Andrew


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to