core-data – 在iOS8中使用本地xml文件抛出错误的核心数据/ iCloud种子

前端之家收集整理的这篇文章主要介绍了core-data – 在iOS8中使用本地xml文件抛出错误的核心数据/ iCloud种子前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
希望这很简单,但我还没能找到修复方法.我有一个应用程序,我正在尝试实现iCloud和Core Data.我希望它可以在iOS7和iOS8上运行.

该应用程序是收藏品的清单/ tableview应用程序.

本质上,该应用程序有一个预先播种的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同步崩溃?任何想法或指示将不胜感激.

扎克

解决方法

扎克,这不是一个答案(我没有代表评论),但它可能会帮助你走上正确的轨道.我正在实施iCloud核心数据,并且遇到了与iOS 8相同的问题……同样“没有URL的文档”错误(对我来说没有移动错误),以及数据同步中的相同细分.两点意见:

>当我在两台设备上运行我的应用程序时,核心数据同步最初效果非常好……比如几分钟和一些更新.然后我得到“无URL文档”错误.
>我的.sqlite数据库非常小,我想要做的更新是适度的(例如添加一个新的实体),所以我不认为文件大小或更新复杂性是因素.
>在记录这些错误的设备上,商店停止从iCloud导入更改.但我在该设备上所做的更改会继续持续存在于其他设备上.所以效果就像一个单向的崩溃.

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

原文链接:https://www.f2er.com/iOS/334376.html

猜你在找的iOS相关文章