CREATE operation not permitted

后端 未结 2 1945
一生所求
一生所求 2021-01-25 17:01

I am trying to utilize CloudKit in my iOS application, but when I attempt to create a new record for for a User record type (record type is named

2条回答
  •  故里飘歌
    2021-01-25 17:29

    In addition to Edwin's answer, it's entirely feasible to save custom fields to the public Users recordType, but you need to retrieve the CKRecordID for the user first (via CKContainer fetchUserRecordID() or discoverUserIdentity()) and then build the CKRecord on Users using that ID.

    Also, if you're using CKModifyRecordsOperation make sure the savePolicy is set to .changedKeys in order to allow the update to go through.

提交回复
热议问题