• 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: Core Data, questions about two models in an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data, questions about two models in an application


  • Subject: Re: Core Data, questions about two models in an application
  • From: Dan Treiman <email@hidden>
  • Date: Mon, 17 Jul 2006 10:22:46 -0500

If you have managed objects that are not saved in documents, you'll need another persistent store to save them in. This is basically a combination of the "Core Data Application", and the "Core Data Document Based Application".

For information about how to manage relationships across persistent stores, check out:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/ Articles/cdUsingMOs.html
particularly in the section on Managed Object IDs and URIs:
"You can use object IDs to define “weak” relationships across persistent stores (where no hard join is possible)."


To do this you'll have to write accessors, and methods for managing deletion - core data has no built-in way to define relationships across persistent stores.

	-Dan

On Jul 17, 2006, at 7:43 AM, rakel wrote:


E.g. let there be a Variable called with title "Operating System". Then the person with name "Piglet" can have a Value for this Variable with the "valueData" attribute set to "Windows" and the person "Winnie the Pooh" can have a Value for the same Variable with "valueData" attribute set to "Mac OS X".


One way is to start with a "Core Data Application" in XCode and have one data model with the entities Person, Value and Variable (this is how I currently do it).

Now to my question:

Another way could be to use a "Core Data Document Based Application" where each person is represented by one document. But since the Variables doesn't belong to any specific person, the Variable data cannot be part of the documents. Hence I would need two models, one model for the meta data and one model for the person data. Data for the "person data model" would be saved with each document. Data for the "meta data model" would be saved "somewhere else". Also, there must be a connection between the Value entity in the "person model" and the Variable entity in the "meta data model".

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Core Data, questions about two models in an application (From: rakel <email@hidden>)

  • Prev by Date: Re: Drag and drop... without moving mouse?
  • Next by Date: Core Data and PostgreSQL
  • Previous by thread: Core Data, questions about two models in an application
  • Next by thread: Re: Core Data, questions about two models in an application
  • Index(es):
    • Date
    • Thread