【问题标题】:How to figure out if the app is using local storage 1 or 0 on iOS7?如何确定应用程序在 iOS7 上使用的是本地存储 1 还是 0?
【发布时间】:2014-02-18 13:37:48
【问题描述】:

我正在尝试在 iOS7 上将 Coredata 与 iCloud 一起使用。
在配置 CoredataUbiquitous 存储时,我们会收到如下控制台日志消息:

CoreData: Ubiquity: mobile~123456789:CoreDataUbiquitous Using local storage: 1

然后,几秒钟后出现以下日志。

CoreData: Ubiquity: mobile~123456789:CoreDataUbiquitous Using local storage: 0

所以,我知道第一个日志是说我们正在使用后备存储,后来确认我们可以访问 iCloud。

但是我如何在代码中知道这一点?如何检测应用是否仍在使用后备商店?

【问题讨论】:

    标签: ios core-data icloud


    【解决方案1】:

    是的,好像没有这样的通知,我也一直在找。显然 NSPersistentStoreDidImportUbiquitousContentChangesNotification 会在连接到 iCloud 并且发生一些数据更改时发生 - 但是在没有数据更改时感知到 iCloud 的连接似乎是不可能的。

    阿里

    【讨论】:

      猜你喜欢
      • 2013-08-31
      • 2017-11-05
      • 1970-01-01
      • 2020-12-30
      • 2013-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多