ios - CloudKit: Error saving record with CKModifyRecordsOperation -
<ckerror 0x14d8cb70: "partial failure" (2/1011); "failed modify records"; partial errors: { b5def0b5-f064-4b27-9c89-be75c9134297:(_defaultzone:__defaultowner__) = <ckerror 0x14d83b70: "server record changed" (14/2037); "error saving record <ckrecordid: 0x15748cd0; b5def0b5-f064-4b27-9c89-be75c9134297:(_defaultzone:__defaultowner__)> server: protection data didn't match"> }>
i error, when try save ckrecord
s cloudkit
. idea?
do have fetch first records in convenience api?
i using ckmodifyrecordsoperation
method update more record.
when planning update, first need read record, make changes , write record. got notification record changed in time between reading , writing record.
if version of record on server newer version tried save, server returns ckerrorserverrecordchanged error. userinfo dictionary of error object contains different versions of conflicting records. use these keys retrieve records , perform whatever resolution logic needed resolve conflict.
as discussed below in case problem persisted object database , recreated ckrecord modification. in case need persist system fields using ckrecord encodesystemfieldswithcoder. , recreate ckrecord initializing nscoder. use nskeyedarchiver , nskeyedunarchiver saving ckrecord , recreating it. if need sample, see fromckrecord , tockrecord methods @ bottom of https://github.com/evermeer/evcloudkitdao/blob/master/appmessage/appmessage/cloudkit/evcloudkitdao.swift
Comments
Post a Comment