First, I’d like to be clear about the behavior NSPersistentCloudKitContainer implements when you use it to share a managed object (NSManagedObject) so we are on the same page: When you save object A to the Core Data store associated with the private database, NSPersistentCloudKitContainer transforms the object to a CloudKit record A, and synchronizes it to the record zone 1 in the CloudKit private database, with zone ID being com.apple.coredata.cloudkit.zone. When you then use NSPersistentCloudKitContainer.share(_:to:completion:) to create a new share (CKShare) and share object A to another user, NSPersistentCloudKitContainer moves record A to a record zone 2, with zone ID being com.apple.coredata.cloudkit.share. . Note that zone 2 is still in the private database. What you call NSPersistentCloudKitContainer.share(_:to:completion:) with an unsaved managed object A. Core Data saves the object for you, and the associated record A will be saved to zone 2. Regarding Core Data relationsh
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: