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

NSTreeController and CoreData question


  • Subject: NSTreeController and CoreData question
  • From: Scott Andrew <email@hidden>
  • Date: Mon, 25 May 2009 10:38:27 -0700

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


  • Prev by Date: NSOperation cancellation
  • Next by Date: Re: How to safely break read stream?
  • Previous by thread: Re: NSOperation cancellation
  • Next by thread: Re: NSTreeController and CoreData question
  • Index(es):
    • Date
    • Thread