lhunath / UbiquityStoreManager

Implements Core Data + iCloud, deals with all the nasty stuff and gives you a clean API.
http://lhunath.github.io/UbiquityStoreManager
Apache License 2.0
391 stars 37 forks source link

Push, pull and merge? #69

Open NorbNorb opened 10 years ago

NorbNorb commented 10 years ago

If I have three devices A, B and C, all working on their own local stores first (iCloud disabled). How can I

My implementations so far are:

[[[AppDelegate sharedAppDelegate] ubiquityStoreManager] deleteCloudContainerLocalOnly:NO];
[[[AppDelegate sharedAppDelegate] ubiquityStoreManager] setCloudEnabled:YES];
[[[AppDelegate sharedAppDelegate] ubiquityStoreManager] deleteCloudContainerLocalOnly:YES];
[[[AppDelegate sharedAppDelegate] ubiquityStoreManager] deleteLocalStore];
[[[AppDelegate sharedAppDelegate] ubiquityStoreManager] setCloudEnabled:YES];
[[[AppDelegate sharedAppDelegate] ubiquityStoreManager] deleteCloudContainerLocalOnly:YES];
[[[AppDelegate sharedAppDelegate] ubiquityStoreManager] setCloudEnabled:YES];

Our observations are that a push of device A followed by a pull of device B work if iCloud wasn't populated before. Devices will be in sync then. But if the devices disable iCloud again and make another push & pull procedure, all pulling devices don't show any data.

We can get the devices back in sync if we do a objective-c[[[AppDelegate sharedAppDelegate] ubiquityStoreManager] deleteCloudContainerLocalOnly:NO]; wait for a short time and then hit the the push and pull buttons on the devices again.