Phantom59
Phantom59

Reputation: 1119

CKQueryOperation right after CKModifyRecordsOperation

in my app I need to fetch all records in a custom zone (~12) shortly after writing them to the private db. The operations are all synchronized via dependencies. The data written to the cloud via CKModifyRecordsOperation is there as seen in the dashboard and verified by correct results in the completion handler. My problem is that CKQueryOperation doesn't return records just written. If somehow I delay the call to CKQueryOperation then it works. This almost sounds like there's somekind of latency between writing and reading.

I've reviewed all the documentation and other than the operation based dependency mechanism I see no way of synchronizing reads and writes.

What am I missing?

Please help!

Ramon.

Edit:

Hello, I found more evidence that there's some undetermined latency when using CloudKit. One thread in SO suggested stitching records to avoid the latency problem. The "stitching" technique was defintely possible in my case; so, I re-wrote my code to take advantage of the technique. And that, basically, bypasses the latency altogther by avoiding the need to load all records.

Here's the link: Stitching Records

Upvotes: 1

Views: 87

Answers (0)

Related Questions