【问题标题】:PFUbiquity error when using Core Data and iCloud使用 Core Data 和 iCloud 时出现 PFUbiquity 错误
【发布时间】:2015-02-04 11:20:46
【问题描述】:

我正在使用 iCloud 同步我的 Core Data 存储。这工作正常。我刚刚注意到,当我启动应用程序时,我收到以下错误消息。这是正常的吗?有什么办法可以防止吗?

谢谢

2014-12-06 10:06:37.337 -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](808): CoreData: Ubiquity:  nobody~sim352B6DF3-0975-5C4B-B561-086A3032D6EA:ContentKeyName
Using local storage: 1
2014-12-06 10:06:37.382 __60-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:]_block_invoke682(1476): CoreData: Ubiquity:  Attempting to download Peers hit a serious error for peers to download Error Domain=BRCloudDocsErrorDomain Code=5 "The operation couldn’t be completed. (BRCloudDocsErrorDomain error 5 - No document at URL)" UserInfo=0x7ff77ac9b110 {NSDescription=No document at URL, NSFilePath=/Users/dev/Library/Developer/CoreSimulator/Devices/0AC7A779-9C6C-4A6C-91C5-D1973CE278D9/data/Library/Mobile Documents/iCloud~app~container/Data/.DS_Store, NSUnderlyingError=0x7ff77ac990d0 "The operation couldn’t be completed. No such file or directory"} with userInfo {
    NSDescription = "No document at URL";
    NSFilePath = "/Users/dev/Library/Developer/CoreSimulator/Devices/0AC7A779-9C6C-4A6C-91C5-D1973CE278D9/data/Library/Mobile Documents/iCloud~app~container/Data/.DS_Store";
    NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\" UserInfo=0x7ff77ac9bee0 {NSDescription=No such file or directory}";
}
2014-12-06 10:06:37.409 -[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](808): CoreData: Ubiquity:  nobody~sim352B6DF3-0975-5C4B-B561-086A3032D6EA:ContentKeyName
Using local storage: 0

【问题讨论】:

  • 听起来好像是在说找不到您的文档。您的文档是否真的不见了?
  • 我不知道 - 它加载数据。但为什么它甚至需要 .DS_Store?
  • 我也在尝试将 icloud 与核心数据一起使用。它似乎对我来说也很好,但我得到了同样的错误信息。该文档没有提及有关此错误的任何内容。不知道该怎么办。请注意,应用程序在设备上中止,但在模拟器上运行良好!
  • 我遇到了同样的错误。我的应用程序使用 Core Data/iCloud 并没有为我或我的用户持续同步。
  • 我遇到了同样的错误,同步无法正常工作。有没有人有解决方案?我刚刚做了一个工作,我从 iCloud 商店重建了商店 - 但这并不是真正的解决方案。

标签: core-data ios8 icloud


【解决方案1】:

根据我的测试,这就是我认为的问题所在。

当您的本地 Core Data 资源与 iCloud 同步时,在另一台设备上删除的所有行都会被删除。通过重复数据删除过程可以删除更多行。

在内存中,您可能持有直接代表已删除行的 ManagedObjects,或者可能与这些行相关。

因此,当您访问这些行的属性时,错误进程希望找到 Core Data 行,但它没有。不一致会导致错误。

我的解决方案:每当收到 NSPersistentStoreCoordinatorStoresDidChangeNotification 或 NSPersistentStoreDidImportUbiquitousContentChangesNotification 时,刷新所有 ManagedObject 子类对象

这对我有用。希望其他人也可以从中获利。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-15
    • 2014-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-31
    相关资源
    最近更新 更多