有没有人知道是否有办法加快上传(图像)到 CloudKit 中的容器?如果我将 Parse 用于相同的功能,它比上传到 CloudKit 快 3 到 4 倍....同样适用于下载。有任何想法吗?
谢谢阿敏
最佳答案
如果您正在使用 saveRecord,则该操作可能被赋予较低的优先级。根据 Apple 文档:
This method saves the record with a low priority, which may cause the task to execute after higher-priority tasks. To save records more urgently, create a CKModifyRecordsOperation object with the desired priority. You can also use that operation object to save multiple records simultaneously.
因此,如果您确实在使用 saveRecord,请尝试使用 CKModifyRecordsOperation 来代替,看看是否可以缩短上传时间。
话虽如此,在上传之前也要尝试尽可能地优化图像。而且,在更改(更新)CKRecords 的情况下,无需保存记录的所有字段(从而重新上传现有图像) - 您可以选择要保存的字段。
希望对您有所帮助!
关于ios - CloudKit 上传速度很慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28034101/