在我的项目中,我将 UIManagedDocument 与 CoreData 和 iCloud 一起使用。在 iCloud 中创建 UIManagedDocument 时似乎有很多错误——尤其是在没有网络服务的情况下。
但是现在我在保存文档以进行创建时遇到了一些奇怪的错误/应用程序崩溃与网络服务(也与 wifi):
-[PFUbiquitySetupAssistant validateOptionsWithError:](262): CoreData: Ubiquity: Error attempting to read ubiquity root url: file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/.
Error: Error Domain=LibrarianErrorDomain Code=1 "The operation couldn’t be completed. (LibrarianErrorDomain error 1 - Unable to initiate item download.)" UserInfo=0x1f56d140 {NSURL=file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/, NSUnderlyingError=0x1d89b4a0 "The operation couldn’t be completed. (UBErrorDomain error 0.)", NSDescription=Unable to initiate item download.}
userInfo: {
NSDescription = "Unable to initiate item download.";
NSURL = "file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/";
NSUnderlyingError = "Error Domain=UBErrorDomain Code=0 \"The operation couldn\U2019t be completed. (UBErrorDomain error 0.)\"";
}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'
*** First throw call stack:
它表示无法完成从事务日志文件夹的下载操作。我无法理解这一点,因为应用程序应该创建一个文档而不是下载任何内容。
顺便说一句,该应用程序的 iCloud 文件夹是空的!
从设备中删除 iCloud 帐户并再次登录也无济于事。该设备是运行 iOS 6 的 iPhone 4S。
有没有人有过类似的经历?
编辑:
现在,经过数百次删除和重建后,我在同一设备上得到了不同的错误:
-[PFUbiquitySafeSaveFile waitForFileToUpload:](268): CoreData: Ubiquity: <PFUbiquityPeerReceipt: ...>(0)
permanentLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/receipt.0.cdt
safeLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.0.cdt
currentLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.0.cdt
kv: (null)
Safe save failed for file, error: Error Domain=NSCocoaErrorDomain Code=512 "The file upload timed out." UserInfo=0x1de36dc0 {NSLocalizedDescription=The file upload timed out.}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'
*** First throw call stack:
不知何故,设备似乎无法访问 iCloud 服务,即使它获得了 iCloud 令牌并且可访问性很好......