CloudKit Batch Fetches?

笑着哭i 提交于 2019-11-28 09:51:54

问题


Using CloudKit, how can I fetch my results in batches?

I know that the default fetch limit it 100 results. So who do I then fetch the subsequent 100 results?

Thanks.


回答1:


The number of records returned by CloudKit is not fixed. CloudKit has a mechanism for deciding how many records to return. It looks like it's currently 100, but it could change depending on the current load on Cloudkit. It is possible to set this to a fixed number on the CKQueryOperation object. The default is:

operation.resultsLimit = CKQueryOperationMaximumResults;

The documentations for this property says: When using that value, the server chooses a limit that aims to provide an optimal number of results that returns as many records as possible while minimizing delays in receiving those records. However, if you know that you want to process a fixed number of results, change the value of this property accordingly.

The CKQueryOperation will return a cursor in the queryCompletionBlock which can then be used to execute an other CKQueryOperation to fetch the next block.



来源:https://stackoverflow.com/questions/27134258/cloudkit-batch-fetches

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!