【问题标题】:NSPersistantStoreCoordinator - addPersistentStoreWithType - going nowhere?NSPersistantStoreCoordinator - addPersistentStoreWithType - 无处可去?
【发布时间】:2012-01-04 06:01:50
【问题描述】:

我想我开始在我的 iPhone 和 Mac 应用程序中实现 iCloud 集成。 有时,设备之间偶尔会同步!

但我发现当应用程序崩溃时,任何更改都不再同步到 iCloud 存储。

一旦 Mac 版本崩溃,我就无法让它再次运行 - 当它在方法内运行 [psc addPersistentStoreWithType:configuration:URL:options:error:] 时似乎卡住了 - (NSPersistentStoreCoordinator *)persistentStoreCoordinator

我没有收到任何错误,它只是无限期地坐在那里(这是在 mac 版本上)。

也是一个单独的问题 - 我是否正确理解我不能使用现有数据库并期望它出现在 iCloud 存储上 - 我将不得不了解如何通过应用程序(对于我在 iCloud 存储上所做的更改)?

感谢您的帮助,

亚当

【问题讨论】:

    标签: iphone macos core-data icloud persistent-storage


    【解决方案1】:

    我对这个问题的解决方案是,如果 ubiquity 目录中不存在文件夹,则将 NSPersistentStoreUbiquitousContentNameKey 设置为 UUID。只要该目录仍然存在,在其他客户端使用此 UUID,否则生成一个新的。

    【讨论】:

      猜你喜欢
      • 2010-12-26
      • 2012-11-28
      • 1970-01-01
      • 1970-01-01
      • 2010-12-22
      • 1970-01-01
      • 1970-01-01
      • 2019-02-22
      • 1970-01-01
      相关资源
      最近更新 更多