核心数据/ iCloud播种与iOS8中的本地xml文件抛出错误

时间:2014-10-25 13:11:51

标签: core-data ios8 icloud

希望这很简单,但我还没能找到修复方法。我有一个应用程序,我正在尝试实现iCloud和Core Data。我希望它可以在iOS7和iOS8上运行。

该应用程序是收藏品的清单/桌面视图应用程序。

实际上,该应用程序有一个预先播种的xml文件,其中包含大约50,000个文件。 sqlite / core数据最初配置为只有1个项目。用户可以从表视图中选择要添加到核心数据存储的组(以便不包括所有50,000个项目)。当用户选择具有1-50个项目的组时,它会解析这些项​​目的xml并将它们写入核心数据存储。当用户选择具有较大文件数量的组时,它会解析并添加它们,但在解析过程中也会抛出一些随机的“无文档处于url”错误。应用程序不会崩溃,并且似乎添加了所有项目,但应用程序停止与iCloud同步。确切的错误是:

__45-[PFUbiquityFilePresenter processPendingURLs]_block_invoke(439): CoreData: Ubiquity:  
Librarian returned a serious error for starting downloads Error Domain=BRCloudDocsErrorDomain Code=5 
"The operation couldn’t be completed. (BRCloudDocsErrorDomain error 5 - No document at URL)" 
UserInfo=0x7fd7f54abea0 {NSDescription=No document at URL, 
NSFilePath=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-      0D52D833E28A/data/Library/Mobile    Documents/iCloud~com~xxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/C45FA553-6CA0-4C26-845B-B478EF7EAD60.1.cdt, 
NSUnderlyingError=0x7fd7f54aa200 "The operation couldn’t be completed. No such file or directory"} 
with userInfo {
NSDescription = "No document at URL";
NSFilePath = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/C45FA553-6CA0-4C26-845B-B478EF7EAD60.1.cdt";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. 
No such file or directory\" UserInfo=0x7fd7f5433240 {NSDescription=No such file or directory}";
} for these urls: (
"file:///Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile%20Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/C45FA553-6CA0-4C26-845B-B478EF7EAD60.1.cdt"
)

然后我也会得到一个“移动”错误(有时在解析完成后):

[PFUbiquityTransactionLog moveFileToPermanentLocationWithError:](761): CoreData: Ubiquity:  
CoreData: Ubiquity: Error writing export log to file: file:///Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile%20Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt
error: Error Domain=NSCocoaErrorDomain Code=516 "The operation couldn’t be completed. (Cocoa error 516.)" 
UserInfo=0x7fd7f49cdfd0 {NSSourceFilePathErrorKey=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxx~xxxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/tempLogs.nosync/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt, 
NSUserStringVariant=(
Move
), NSDestinationFilePath=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt, 
NSFilePath=/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxx~xxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/tempLogs.nosync/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt, 
NSUnderlyingError=0x7fd7f497f430 "The operation couldn’t be completed. File exists"}
userInfo: {
NSDestinationFilePath = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxx~xxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt";
NSFilePath = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/tempLogs.nosync/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt";
NSSourceFilePathErrorKey = "/Users/zacharyfisher/Library/Developer/CoreSimulator/Devices/4B70FCFC-4704-4C83-B848-0D52D833E28A/data/Library/Mobile Documents/iCloud~com~xxxxxxx~xxxxxxx/CoreData/iCloud/nobody~sim43DA22C4-427B-5FCD-9B61-90CE79638F6B/tempLogs.nosync/iCloud/PZbSJk1f2RNB6ucDj0Y6VqL1KgXYAxi4LcApXONjvnQ=/ABE37211-02B7-4F20-B631-B5D91B23E9BE.1.cdt";
NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=17 \"The operation couldn\U2019t be completed. File exists\"";
NSUserStringVariant =     (
    Move
);

}

有关如何解决此问题的任何想法?我是否试图同时进行太多更改,这会导致核心数据/ icloud同步崩溃?任何想法或指示都将不胜感激。

扎克

1 个答案:

答案 0 :(得分:3)

扎克,这不是一个答案(我不会让代表发表评论),但它可能会帮助你走上正轨。我正在实施iCloud核心数据,并且遇到了与iOS 8相同的问题...相同" URL上没有文档"错误(对我来说没有移动错误),以及数据同步中的相同故障。两个观察结果:

  • 当我在两台设备上运行我的应用时,核心数据同步最初效果非常好......比如几分钟和一些更新。然后我在URL"处获得了#34;没有文档。错误。

  • 我的.sqlite数据库非常小,我尝试做的更新是适度的(例如添加一个新实体),所以我不认为文件大小或更新复杂性是因素。

  • 在记录这些错误的设备上,商店停止从iCloud导入更改。但是我在该设备上所做的更改会继续保留到其他设备上。所以效果就像是单向分解。

希望这会有所帮助。非常感谢您所取得的任何进展。几个星期以来,我一直在努力解决这个问题,并且即将放弃并运送应用程序(这是通用的)而没有iCloud数据同步。