3

I'm using NSPersistentCloudKitContainer in my app in production but some of my users are informing me that data is missing after updating to recent version which introduced NSPersistentCloudKitContainer. For majority of my users it's working without problems.

These users have checked in iCloud settings if iCloud is turned on for my app. What can I do to prevent missing data while using NSPersistentCloudKitContainer

Wojtek
  • 1,006
  • 11
  • 30
  • An individual subscriber to the Apple Development Program has the ability to submit two technical requests per year, included in your subscription fee and therefore free of charge. I’d encourage you to use one of these requests for this problem... it is a significant issue that is affecting your users. – andrewbuilder Oct 02 '19 at 22:49
  • What exactly is the problem - is the data missing, or is the syncing not occurring (or occurring very slowly)? I am trying to implement it in my apps and it's a real pain for existing users as their databases are so large, NSPersistentCloudKitContainer keeps giving '.limitExceeded' errors as there are too many requests (ie. > 400) - the result is that it takes days to sync, but looks like it's missing data in the meantime. There is also NO way to see if syncs are pending to use this to update the UI so the user knows what's going on. It's a little TOO opaque I think. – Paul Martin Oct 20 '19 at 01:34
  • The problem is - user was using my app before iOS13, then when I added NSPersistentCloudKitContainer and they updated to iOS13 all data went missing. Fortunately only few of my users had this problem so far. – Wojtek Oct 20 '19 at 10:59

1 Answers1

2

Did you solve this issue?

It might be problem of NSPersistentHistoryTrackingKey setting for NSPersistentContainer.

If you use NSPersistentContainer without NSPersistentHistoryTrackingKeyoption as True, NSPersistentCloudKitContainer cannot track the existing data.

In my case, I force sync to add new boolean attribute to core data model. And batch operation to all data to set true as new attribute.

hanung
  • 41
  • 3