【问题标题】:iCloud low speed to retrieve dataiCloud 低速检索数据
【发布时间】:2013-04-04 09:08:47
【问题描述】:

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

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

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

【问题讨论】:

    标签: ios core-data icloud magicalrecord


    【解决方案1】:

    只需使用 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
        });
    }); 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-03
      • 2011-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多