I think I am starting to get somewhere with iCloud integration in my iPhone and Mac apps.
Sometimes things are occasionally syncing between the devices!
But I find that when the apps do crash that any changes are no longer sync to the iCloud storage.
And once the Mac version crashes I can’t get it going again – and seems to get stuck when it reaches running the [psc addPersistentStoreWithType:configuration:URL:options:error:] inside the method – (NSPersistentStoreCoordinator *)persistentStoreCoordinator
I don’t get any errors, it just sits there indefinitely (This is on the mac version).
Also a separate issue – am I correct in understanding that I can’t use an existing database and expect it to appear on the iCloud storage – I will have to some how import it or migrate it into the new sqlite db via the app (for the changes to me made onto the iCloud storage)?
Thanks for any help,
Adam
My solution to this problem is to set NSPersistentStoreUbiquitousContentNameKey to a UUID if a folder doesn’t already exist in the ubiquity directory. Use this UUID in other clients as long as the directory still exists, otherwise generate a new one.