gpt4 book ai didi

ios - iCloud低速检索数据

转载 作者:行者123 更新时间:2023-11-29 11:01:17 24 4
gpt4 key购买 nike

我在我的应用程序中使用了 Core Date 和 iCloud,但是检索数据的速度太慢了。为了创建核心数据堆栈,我使用了 MagicalRecords 方法

[MagicalRecord setupCoreDataStackWithiCloudContainer:nil localStoreNamed:@"base"];

我可以检索不在主线程中的数据吗?加载需要很多时间。

最佳答案

只需使用 GCD。

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[MagicalRecord setupCoreDataStackWithiCloudContainer:nil
localStoreNamed:@"base"];

dispatch_async(dispatch_get_main_queue(), ^{
// update your UI if necessary
});
});

关于ios - iCloud低速检索数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15806935/

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