• 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: iClass example, core data and multiple stores
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iClass example, core data and multiple stores


  • Subject: Re: iClass example, core data and multiple stores
  • From: Melissa Turner <email@hidden>
  • Date: Wed, 10 May 2006 13:19:03 -0700

You forgot to look at the model.

If you look at the model in XCode, you'll see that there are 2 configurations set up (click the thing that looks like a wrench in the top right corner of the entity detail view), and that the various entities have been assigned to specific configurations. When the public and private stores are added, you'll note that the configuration parameter to addPersistentStoreWithType:configuration:URL: options:error: is non- nil and specifies which configuration is in that store.

iClass doesn't need to programatically direct instances of Teacher/ Student/Course to stores, because each of those entities can only be persisted to one store, and Core Data routes them automatically. IDGenerators can live in either store, so they do need to be specifically assigned to achieve the desired effect.

+Melissa

On May 10, 2006, at 11:44, Greg Stark wrote:

Thanks. I'd read the ReadMe file and Core Data Programming Guide (as well as Cocoa Fundamentals and several Core Data tutorials), but I figured since you mentioned them I'd read them again.

The ReadMe file mentions that entities are directed automatically to stores through the use of configurations, but where? The only item I see explicitly directed to a specific store the IDGenerator entity. That one item is clear, and it's done as suggested in the Core Data Programming Guide. However, I still don't see where the Teacher and Student entities are directed to privateStore or where the Course entity is directed to the publicStore.

The Core Data Programming Guide reference that you referred to, while well written and informative, seems to handle assigning objects to specific stores a little differently than how the iClass example does it for the Teacher, Student and Course entities. It's how the Teacher, Student and Course entities are handled that I don't understand.

Any other ideas as to where to look for help?

-Greg

On May 9, 2006, at 11:07 PM, mmalcolm crawford wrote:


On May 9, 2006, at 7:08 PM, Greg wrote:

For example, I see where the privateStore and publicStore stores are created, but I don't see where specific managed objects are assigned to these stores (e.g., where a teacher entity is assigned to the privateStore and a course entity is assigned to the publicStore). I've looked through both the example code and the NIB bindings but have yet to figure this out.

The example also comes with a ReadMe...
See also <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdCreateMOs.html#//apple_ref/doc/uid/TP40001654-208209 >


mmalc

_______________________________________________
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


_______________________________________________ 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

_______________________________________________ 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: 
 >iClass example, core data and multiple stores (From: Greg <email@hidden>)
 >Re: iClass example, core data and multiple stores (From: mmalcolm crawford <email@hidden>)
 >Re: iClass example, core data and multiple stores (From: Greg Stark <email@hidden>)

  • Prev by Date: Re: C++ gets translated into ObjC? Strange compiler errors...
  • Next by Date: Re: object type testing
  • Previous by thread: Re: iClass example, core data and multiple stores
  • Next by thread: NSKeyedUnarchiver questions
  • Index(es):
    • Date
    • Thread