Wojtek
Wojtek

Reputation: 1044

NSPersistentCloudKitContainer losing data

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

Upvotes: 5

Views: 294

Answers (1)

hanung
hanung

Reputation: 51

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.

Upvotes: 2

Related Questions