NSPersistentCloudKitContainer can't get record from NSManagedObjectId

I try to figure out if it's possible to share a users core data events in one app, to another user with CKShare and CKRecord.

I got the device sync up and running and can see the changes, also CloudKit dashboard has published the changes to production.


However, when I have my NSManagedObject that I got either local or from another device, I try to call the following:


let myEvent: // NSManagedObject from core data

let container: NSPersistentCloudKitContainer = AppDelegate.shared.container

let record = container.record(for myEvent.objectID // not working


// record is always nil


The receord is always nil, why?

And is is possible to later pass the CKRecord in a UICloudSharingController to share it to another user?

I'm currently facing the same issue (Also for fetching record IDs). As far as Apple stated here, this function can be used for creating shares, but I'm not sure if the NSPersistentCloudKitContainer is able to work with shared databases.

I am also seeing this issue. Not able to access CKRecords from managed objects. I need this functionality for creating shares as well. Is there any known work-around?

I'm having the same issue and cannot determine if sharing via UICloudSharingController will work with the new ios 13 feature. I wish someone from Apple would respond so we could plan.

I had the same issue, however this just started working on me on xcode 11.1

NSPersistentCloudKitContainer can't get record from NSManagedObjectId
 
 
Q