Questions about iCloud + core data

I have an app in an app store that uses coredata as storage. I will not update the iCloud sync app as a new feature. Following Apple's exemplary code, I was able to sync the main storage across devices.

However, I am having problems when either iCloud sync is disabled / enabled in the app on only one of the devices, or when the app is removed from the device and reinstalled. In both cases, the data is not synced to the device, although on the other device it is accessible just fine (which has not been disabled / reinstalled).

I also found that all storage is completely erased completely when I uninstall the app from all devices and then reinstall it. Althrough I get a couple of merge notifications in the console (even some of them without error), I can't see any data in the local storage of the device.

Browsing the mobile document folders on my computer still shows a lot of transaction logs in my app's icloud storage.

Even removing the app from all devices and starting from scratch doesn't sort it out. I will end up in a situation where data is either syncing with only one device, or not syncing at all.

I wonder if there is anything I can do in this inconsistent state that is created when only one device is temporarily disabled by iCloud, or the app is removed from ONE device?

As for my code, its a 1: 1 instance of the apple recipe example.

+3


source to share


2 answers


Daniel Pasco talked about using Core Data and iCloud together at NSConference 2012. Some notes from this blog post:

running with -com.apple.coredata.ubiquity.logLevel 3 to get spam in the message log talking about what Core Data and iCloud are doing.

The takeaway from this conversation is that the use of Core Data and iCloud at this stage is really not ready for each other.



He posted a draft of the updated Core Data Recipes project on Github , which may or may not solve your problem.

+2


source


Apple makes it easy, but there are many nuances about properly seeding iCloud with data, and what happens then when iCloud support is turned on and off on different devices.

I've implemented a sample project that demonstrates an easy way to add iCloud support to library-style CoreData apps. It's called iCloudStoreManager and is available on github .



I am still testing it before adding iCloud support to one of my own apps. It works, but I see unexpected errors and lags when the iPad 3 is in the mix. It works, but with long delays.

I've also tested the iPhone 4, iPhone 4S, and the original iPad, and any combination of those devices works well in my experience.

+1


source







All Articles