Skip navigation.
 
mlRe: CoreData - multiple stores advice...
FROM : mmalc crawford
DATE : Tue Jan 29 14:06:12 2008

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

Related mailsAuthorDate
mlCoreData - multiple stores advice... Martin Linklater Jan 25, 13:34
mlRe: CoreData - multiple stores advice... Martin Linklater Jan 25, 14:48
mlRe: CoreData - multiple stores advice... mmalc crawford Jan 25, 17:12
mlRe: CoreData - multiple stores advice... William Turner Jan 25, 17:17
mlRe: CoreData - multiple stores advice... Martin Linklater Jan 29, 13:50
mlRe: CoreData - multiple stores advice... mmalc crawford Jan 29, 14:06
mlRe: CoreData - multiple stores advice... Martin Linklater Jan 29, 15:57
mlRe: CoreData - multiple stores advice... mmalc crawford Jan 29, 16:45
mlRe: CoreData - multiple stores advice... Martin Linklater Jan 29, 18:12
mlRe: CoreData - multiple stores advice... mmalc crawford Jan 29, 18:17