• 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
configurePersistentStoreCoordinatorForURL:ofType: modelConfiguration: storeOptions:error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

configurePersistentStoreCoordinatorForURL:ofType: modelConfiguration: storeOptions:error


  • Subject: configurePersistentStoreCoordinatorForURL:ofType: modelConfiguration: storeOptions:error
  • From: Chris Idou <email@hidden>
  • Date: Wed, 30 Jun 2010 16:42:39 -0700 (PDT)


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 (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

  • Follow-Ups:
    • Re: configurePersistentStoreCoordinatorForURL:ofType: modelConfiguration: storeOptions:error
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: NSString ambiguities
  • Next by Date: Re: How to revert to an unedited document & window?
  • Previous by thread: Re: NSString ambiguities
  • Next by thread: Re: configurePersistentStoreCoordinatorForURL:ofType: modelConfiguration: storeOptions:error
  • Index(es):
    • Date
    • Thread