Re: CoreData - multiple stores advice...
Re: CoreData - multiple stores advice...
- Subject: Re: CoreData - multiple stores advice...
- From: mmalc crawford <email@hidden>
- Date: Tue, 29 Jan 2008 05:06:12 -0800
On Jan 29, 2008, at 4:50 AM, Martin Linklater wrote:
But how do I actually create this in code ? The only way to create a
Persistent Store Coordinator is to give it a MOM...
[NSPersistentStoreCoordinator initWithManagedObjectModel] - but I
have mutiple MOMs - one for each Store... which one do I pass in ?
Per the original reply, you can only have one MOM per coordinator. So
you can't directly do what you're asking. That's why it's not
documented.
I could always create the NSPersistentStores myself using
[NSPersistentStore initWithPersistentStoreCoordinator], but then I
need to pass in a 'managed object model configuration' - what's
this ? I have my managed object models - what is the 'configuration'
bit ?
"A configuration is a named collection of entities in the model."
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdMOM.html
>
and
<http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/02_40_design_data_modeling/chapter_17_section_4.html
>
If you want to have different entities in different stores, you have
to create a model that's a superset of all the entities you're going
to deal with and that defines the subsets as configurations. For each
individual store, you specify the configuration.
mmalc
_______________________________________________
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