According to the doco, the above method is used to "customise creation of the 
persistent store" especially with regards to the store type. So I've been using 
the below code, which works perfectly fine for NSBinaryStoreType and 
NSXMLStoreType, but with NSSQLiteStoreType I get lots of merge errors when 
saving documents that I don't get if I completely remove the below code and let 
the framework handle it. Apparently I'm doing something subtlety wrong. Does 
anyone know what? At times like this I wish Apple would make their source code 
visible to developers.




- (BOOL)configurePersistentStoreCoordinatorForURL:(NSURL *)url ofType:(NSString 
*)fileType modelConfiguration:(NSString *)configuration 
storeOptions:(NSDictionary *)storeOptions error:(NSError **)error; {
if(![[[selfmanagedObjectContext] persistentStoreCoordinator] 
addPersistentStoreWithType:NSSQLiteStoreTypeconfiguration:nilURL:url 
options:[NSDictionarydictionaryWithObjectsAndKeys:[NSNumbernumberWithBool:YES], 
NSMigratePersistentStoresAutomaticallyOption, [NSNumbernumberWithBool:YES], 
NSInferMappingModelAutomaticallyOption, nil] error:error]){
        [[NSApplicationsharedApplication] presentError:*error];
returnNO;
    } else {
returnYES;
}
}



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to