當我嘗試將新創建的UIManagedDocument保存到iCloud並且網絡出現故障(例如飛行模式)時,出現以下錯誤崩潰(hexcodes和不可讀的東西刪除):UIManagedDocument:網絡關閉時創建新文件時出現錯誤/崩潰(保存)
-[PFUbiquitySafeSaveFile waitForFileToUpload:](272): CoreData: Ubiquity: <PFUbiquityPeerReceipt: ...>(0)
permanentLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~domain~AppName/TransactionLog/mobile.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/DocumentName/XXXXXXXXXXXXXXX/receipt.0.cdt
safeLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~domain~AppName/TransactionLog/mobile.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/DocumentName/XXXXXXXXXXXXXXX/mobile.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.0.cdt
currentLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~domain~AppName/TransactionLog/mobile.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/DocumentName/XXXXXXXXXXXXXXX/mobile.XXXXXXXX-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=... {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:
(...)
libc++abi.dylib: terminate called throwing an exception
我不知道這個錯誤,但它說,文件無法保存,因爲沒有上傳是可能的(當然,因爲沒有網絡)。但我不明白爲什麼我不能保存完成處理程序捕獲此錯誤:
[theDocumentToSave saveToURL:theDocumentToSave.fileURL
forSaveOperation:UIDocumentSaveForCreating
completionHandler:^(BOOL success) {
if (success) {
// Do somethings, go on, ...
} else {
// Catch error HERE, but this is never called!
}
}];
什麼版本的iOS? – 2013-03-01 18:52:12
在運行當前iOS 6.1.2的iPhone 4設備上發生錯誤 – FrankZp 2013-03-01 18:53:31