I'm working on an app that uses Core Data and iCloud to sync data between multiple iPads. This is all working fine and I can add data to each iPad and it will sync between them all.
I have a Core Data sqlite file that is pre-populated with a list of countries and I want to copy this to the documents area on first run of the app. I had this working but have changed my persistentStoreCoordinator implementation to test for iCloud support or not and a couple of other small changes.
However now when I check to see if the sqlite file exists and copy the pre-populated sqlite file if it doesn't I get the following error at
[psc addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:[NSURL fileURLWithPath:iCloudData] options:options error:&persistentStoreError];
NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:: CoreData: Ubiquity: An error occured while setting up the ubiquity integration: Error Domain=NSCocoaErrorDomain Code=134316 "The ubiquity container does not appear to match this persistent store, it is possible this is caused by switching to a different iCloud account, or logging out of iCloud entirely. The store should be re-opened with read-only attributes or removed from iCloud syncing permanently." UserInfo=0x1cb590 {storeUUID=31381598-EAFA-4550-9B96-F501800974D5, containerUUID=E3A8DC7D-41FD-405A-8D8A-C06C8B467CA2, NSLocalizedDescription=The ubiquity container does not appear to match this persistent store, it is possible this is caused by switching to a different iCloud account, or logging out of iCloud entirely. The store should be re-opened with read-only attributes or removed from iCloud syncing permanently.}
Is this because there are still references in iCloud to a different Core Data sqlite file or transaction log files? If so how would I remove them?