ios - CKRecord set parent error 4097 -
i'm trying set parent on ckrecord. basically, reminder child of list. list exists on server.
let record = ckrecord(recordtype: "reminder", recordid: recordid) let listid = ckrecordid(recordname: listname, zoneid: listzoneid) record["title"] = "test todo" record.setparent(listid) let modifyrecordsop = ckmodifyrecordsoperation(recordstosave:[record], recordstodelete:nil) modifyrecordsop.modifyrecordscompletionblock = { (_, _, error) in guard error == nil else { print(error) return } }
every time this, following error: [logfacilityck] got connection error operation 28174dd7caf85542: error domain=nscocoaerrordomain code=4097 "connection service named com.apple.cloudd" userinfo={nsdebugdescription=connection service named com.apple.cloudd}
if remove setparent line, record created on server. doing wrong?
it because listid record not yet saved cloud, therefore cloud cannot set listid
parent of record
. try saving both newly created records:
let modifyrecordsop = ckmodifyrecordsoperation(recordstosave:[record, listid], recordstodelete:nil)
Comments
Post a Comment