Closed AlwaysBee closed 1 year ago
I haven't tested this project with CloudKit and I have no idea what to expect with CloudKit enabled. I'm sure it complicates things, since it adds a cloud store in addition to the local store, but I don't know how to resolve that.
Hi Tom, sorry to bother you again. When I run this demo, every thing worked fine. But when I enabled the iCloud, and add some data, then I can see the same data in iCloud Developer Dashboard.
Then:
It looks OK until I relaunch the App, the data I deleted in Step 2 just disappear.
What I can found some useful info from the Debug Area in Xcode are:
CoreData+CloudKit: -[NSCloudKitMirroringDelegate tearDown:]_block_invoke(806): <NSCloudKitMirroringDelegate: 0x28321c540>: Told to tear down with reason: Store Removed
It showed after I tap the restore button.
So I think this will leading the iCloud Syncing stop, then the backup data did not synced to iCloud.
I also tried the migratePersistentStore version, but it has the same issue.
Of cause, I can delete all data of the App store in iCloud before restore to avoid this issue.