I have tried modifying the Apple SharedCoreData sample for my own apps.
All is (reasonably) ok, except for this warning:
[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:](1055): CoreData: Ubiquity:
Error: A persistent store which has been previously added to a coordinator using the iCloud integration options must always be
added to the coordinator with the options present in the options dictionary.
If you wish to use the store without iCloud, migrate the data from the iCloud store file to a new store file in local storage.
file://localhost/Users/david/Library/Containers/.../Data/Documents/SharedCoreDataStores/localStore.sqlite
This will be a fatal error in a future release.
Has anyone come across this and how do I resolve it?
when you see this error, you are adding a store file contains iCloud metadata,
means that file has added to iCloud.
you should add the options when adding a iCloud Store:
self.iCloudCoreDataContentName(require) is any name you want, a iCloud store, a nameself.iCloudCoreDataContentURL(optional) locate the core data transfer logs in iCloud containerthis URL should be a subdirectory of the iCloud container, like
[[NSFileManager URLForUbiquityContainer:nil] URLByAddingComponent:@"CoreDataLogs"].this property is optional in options. If you omit it, the iCloud CoreData Content URL will be
[NSFileManager URLForUbiquityContainer:nil].more detail about the URLs and name you should notice:
Xcode – "The provided ubiquity name is already in use" – how do I find a folder
If you want to turn a iCloud store to a local store, you can see my answer at:
How can I migrate the data from the iCloud store file to a new store file in local storage?