DESCRIPTION I have an App use iCloud to save data.
- The App had a CoreData ManagedObject 'Product', 'Product' Object had an attribute name 'count' and it is a Double Type.
- I need to synchronises 'count' property across multiple devices.
for example:
- I have a devices A、B.
- A device set 'Product.count' = 100.
- B device set 'Product.count' = 50.
- I hope the 'Product.count' == 150 that results.
- how to synchronises the 'Product.count' == 150 for multiple devices.
- If I have more devices in future, How to get the latest 'Product.count' that it is correct result.
Given that you are already using Core Data, you can consider using NSPersistentCloudKitContainer.
If the data you would synchronize is as simple as several values, you can consider using the CloudKit framework as well, which gives you more flexibility.
You might want to start with looking into the above APIs, and follow up with your further questions, if any.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.