Reputation: 2205
NSPersistentCloudKitContainer automatically creates all CKRecords for NSManagedObjects, so...
How to get access to this process and set CKRecord.parent before changes will be synched.
I need each CKRecord of type B to have parent record of type A, but avoid fully manual handling of setParent(:) as fully separate mechanism.
Upvotes: 2
Views: 239
Reputation: 1044
After you save to Core Data, you can get the CKRecord with the functions provided by NSPersistentCloudKitContainer read here.
Than you can set parent to record and save it to database with CKModifyRecordsOperation for example, yes you must use CloudKit operations for this to work.
Upvotes: 1