Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increment field value in a CKRecord variable without fetching?

Tags:

ios

cloudkit

I am curious is it somehow possible to increment a field value in a CKRecord variable without fetching? So on client I am not curious about the recent value, I just want to increase whatever be the value is. The reason, operation should be as quick and easy as possible, instead of two message 'stream', I want initiate only one.

like image 776
János Avatar asked Oct 17 '25 14:10

János


1 Answers

Unfortunately you can not. You have to read, change and then write the record. Make sure that you use the CKModifyRecordsOperation and leave the savePolicy to CKRecordSaveIfServerRecordUnchanged If you get an error then you could try read and write the record again.

like image 99
Edwin Vermeer Avatar answered Oct 20 '25 03:10

Edwin Vermeer