gpt4 book ai didi

ios - discoverAllContactUserInfosWithCompletionHandler 更快?

转载 作者:行者123 更新时间:2023-11-28 21:51:29 29 4
gpt4 key购买 nike

如何为 discoverAllContactUserInfosWithCompletionHandler 创建优先级高于默认值的 CKOperation?

我找不到不使用 [[CKContainer defaultContainer] discoverAllContactUserInfosWithCompletionHandler: 查询所有用户信息的示例,它的优先级非常低,需要很长时间才能完成。

最佳答案

discoverAllContactUserInfosWithCompletionHandler 的 CloudKit 文档是这样说的:

This method searches for the users asynchronously and with a low priority. If you want the task to execute with a higher priority, create a CKDiscoverAllContactsOperation object and configure the desired priority.

你可以这样设置优先级:

var operation: CKDiscoverAllContactsOperation = CKDiscoverAllContactsOperation()
operation.queuePriority = NSOperationQueuePriority.High

如何使用 CKDiscoverAllContactsOperation 的示例代码可以在这里找到:Any working sample code for CKDiscoverAllContactsOperation for IOS8 beta CloudKit?

关于ios - discoverAllContactUserInfosWithCompletionHandler 更快?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28161684/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com