cloudkit

Which API is the replacement for Core Data with iCloud

筅森魡賤 提交于 2021-01-27 05:33:57
问题 Update, June 2016: As of the most recent documentation for NSPersistentStoreCoordinator, everything related to Core Data with iCloud is marked as deprecated. As a result it should probably be avoided for new development. Using Core Data, iCloud and CloudKit for syncing and backup and how it works together Important The use of iCloud with Core Data has been deprecated and is no longer being supported. About using iCloud with Core Data I've been reading about integrating iCloud with Core Data.

How can I get only unique record in coredata+cloudkit(NSPersistentCloudKitContainer) environment?

扶醉桌前 提交于 2021-01-24 20:27:11
问题 For example, I have a entity named User in public database of Cloukit. Every new user using the App will record his identity in it, and only one record. But in coredata+cloudkit environment, there is a user, two apple devices, two this Apps, one cloud. Firstly, the user use this App on the phone A, check existence of User in local coredata when startup, not exist, so create a User record. It's ok. Days later, the user do the same on the second Phone B, record not exist in local(not sync from

How can I get only unique record in coredata+cloudkit(NSPersistentCloudKitContainer) environment?

断了今生、忘了曾经 提交于 2021-01-24 20:25:10
问题 For example, I have a entity named User in public database of Cloukit. Every new user using the App will record his identity in it, and only one record. But in coredata+cloudkit environment, there is a user, two apple devices, two this Apps, one cloud. Firstly, the user use this App on the phone A, check existence of User in local coredata when startup, not exist, so create a User record. It's ok. Days later, the user do the same on the second Phone B, record not exist in local(not sync from

How can I get only unique record in coredata+cloudkit(NSPersistentCloudKitContainer) environment?

时光怂恿深爱的人放手 提交于 2021-01-24 20:18:10
问题 For example, I have a entity named User in public database of Cloukit. Every new user using the App will record his identity in it, and only one record. But in coredata+cloudkit environment, there is a user, two apple devices, two this Apps, one cloud. Firstly, the user use this App on the phone A, check existence of User in local coredata when startup, not exist, so create a User record. It's ok. Days later, the user do the same on the second Phone B, record not exist in local(not sync from

Cannot delete CKRecords with `.parent` set

最后都变了- 提交于 2021-01-24 09:20:56
问题 I am using CloudKit Sharing and am having an issue deleting records. I create two records: an Entry and an Asset. If I set the .parent of the Asset to point to the Entry, then when I attempt to delete both the Entry and the Asset in the same batch, it fails with a reference violation error: <CKError 0x600002ac2190: \"Reference Violation\" (31/2025); server message = \"Record delete would violate validating reference ([a1]), rejecting update\" Details I create a parent record (Entry) and a

Cannot delete CKRecords with `.parent` set

。_饼干妹妹 提交于 2021-01-24 09:11:50
问题 I am using CloudKit Sharing and am having an issue deleting records. I create two records: an Entry and an Asset. If I set the .parent of the Asset to point to the Entry, then when I attempt to delete both the Entry and the Asset in the same batch, it fails with a reference violation error: <CKError 0x600002ac2190: \"Reference Violation\" (31/2025); server message = \"Record delete would violate validating reference ([a1]), rejecting update\" Details I create a parent record (Entry) and a

CoreData+CloudKit | On/off iCloud sync toggle

六眼飞鱼酱① 提交于 2021-01-20 20:27:39
问题 I want to give the user the option to toggle iCloud sync on and off. After researching for a while, I saw that one way one could achieve this is by setting the cloudKitContainerOptions . So I would set it to nil if I don't want my database to be synched. if(!UserDefaultsManager.shared.iCloudSyncOn) { description.cloudKitContainerOptions = nil } That's all working fine, but I haven't found a way to do that during runtime. I have tried to reinitialize my container when the user toggles, so that

Cannot share CloudKit CKShare record

大兔子大兔子 提交于 2021-01-01 10:11:36
问题 I'm trying to implement cloud kit sharing in my application, however, whenever I try to share an item using a UICloudSharingController I'm getting a consistent error: I am presented with the initial share popover for adding people, and then when I select one of the options on how I'd like to send the invitation (i.e: by mail), the UICloudSharingControllerDelegate returns calling: func cloudSharingController(_ csc: UICloudSharingController, failedToSaveShareWithError error: Error) And throws

Cannot share CloudKit CKShare record

回眸只為那壹抹淺笑 提交于 2021-01-01 10:10:55
问题 I'm trying to implement cloud kit sharing in my application, however, whenever I try to share an item using a UICloudSharingController I'm getting a consistent error: I am presented with the initial share popover for adding people, and then when I select one of the options on how I'd like to send the invitation (i.e: by mail), the UICloudSharingControllerDelegate returns calling: func cloudSharingController(_ csc: UICloudSharingController, failedToSaveShareWithError error: Error) And throws

Swift / CloudKit: After record changed, upload triggers “Service Record Changed”

拥有回忆 提交于 2020-12-30 07:24:15
问题 I'm trying to add a CKReference to a record in cloud kit, but the attempt keeps triggering "Service Record Changed". From the console messages my println's have shown (console messages and code below), I'm uploading said record with 0 references, then when I attach the reference I'm seeing an attempt to upload the record with 1 reference. Then I'm getting the error. As I understand it, "Service Record Changed" shouldn't be triggered because the values in the Reference List have changed (the