ios - CloudKit 上传速度很慢

标签 ios xcode swift icloud cloudkit

有没有人知道是否有办法加快上传(图像)到 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/

相关文章:

iOS Swift 雷达图 TableView y 轴最大值和最小值在绘图上不起作用

ios - 在屏幕/ View 中包含 Sprite 节点

iOS UITableView headerView 没有隐藏

ios - 更改要关闭的 UIButton

ios - Jenkins 在不生成 IPA 文件的情况下成功

ios - Swift:如何从日期选择器获取天,月和年的字符串值?

ios - PFGeoPoint 永久保存在 map 上的东西?

c++ - 如何在 iOS Objective-C 中捕获 C++ 异常代码?

ios - Swift TextField 问题

ios - 带有 uitableviewdatasource 的快速协议(protocol)