• 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: NSTreeController and CoreData question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTreeController and CoreData question


  • Subject: Re: NSTreeController and CoreData question
  • From: Scott Andrew <email@hidden>
  • Date: Mon, 25 May 2009 20:26:04 -0700

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


References: 
 >NSTreeController and CoreData question (From: Scott Andrew <email@hidden>)

  • Prev by Date: Re: Emulating Carbon menu bevel button?
  • Next by Date: Re: NSTreeController and CoreData question
  • Previous by thread: NSTreeController and CoreData question
  • Next by thread: Re: NSTreeController and CoreData question
  • Index(es):
    • Date
    • Thread