Uniqueness of NSPersistentStoreUbiquitousContentNameKey for iCloud and Master Data

In my application, which allows users to synchronize the contents of master data on their multiple devices, how uniquely should I make NSPersistentStoreUbiquitousContentNameKey?

those. should it be unique in the sense of having a device identifier? So, if the user runs the application on their iPhone, does he have one NSPersistentStoreUbiquitousContentNameKey, and if they run it on his iPad, is there another NSPersistentStoreUbiquitousContentNameKey?

Or is it just unique from application to application? That is, if I have application A, does it have one NSPersistentStoreUbiquitousContentNameKey and application B has another NSPersistentStoreUbiquitousContentNameKey?

+6
source share
2 answers

The goal is to uniquely identify persistent storage in a user account. Therefore, if there is only one permanent store in the application (for example, the todo list), then each installation of this application can use the same value for this key, but if you want to have several permanent stores, each of them will need a unique key value here. Does it help?

+2
source

From apple documents:

The content name is used to identify the repository across devices, so that transactions are sequentially synchronized with potentially many instances of this persistent repository file across all devices. For this reason, you must make sure that the name for each repository is, for example, UUID.

https://developer.apple.com/library/IOs/releasenotes/DataManagement/RN-iCloudCoreData/

0
source

Source: https://habr.com/ru/post/957803/


All Articles