我使用iCloud存储iPad应用的核心数据信息。我使用Magical Record提供的帮助方法来处理与Core Data相关的所有内容。
昨天我的应用程序在访问Core Data时开始表现得很奇怪。即使数据库完全为空(应用程序的干净安装),应用程序也会完全冻结并花费大量时间加载。 等了好几分钟之后会发出一个错误,说iCloud超时了。出现以下错误:
-[PFUbiquitySafeSaveFile waitForFileToUpload:](268): CoreData: Ubiquity: <PFUbiquityPeerReceipt: 0x1f85c580>(0)
permanentLocation: <PFUbiquityLocation: 0x1f85c5d0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/receipt.0.cdt
safeLocation: <PFUbiquityLocation: 0x1f85ce30>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C.0.cdt
currentLocation: <PFUbiquityLocation: 0x1f85ce30>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C.0.cdt
kv: (null)
Safe save failed for file, error: Error Domain=NSCocoaErrorDomain Code=512 "The file upload timed out." UserInfo=0x1f85d520 {NSLocalizedDescription=The file upload timed out.}
2013-01-03 16:03:35.276 MyAppName[188:1503] +[MagicalRecord(ErrorHandling) defaultErrorHandler:](0x12059c) Error: The file upload timed out.
2013-01-03 16:03:35.277 MyAppName[188:1503] +[MagicalRecord(ErrorHandling) defaultErrorHandler:](0x12059c) Error Message: The file upload timed out.
2013-01-03 16:03:35.278 MyAppName[188:1503] +[MagicalRecord(ErrorHandling) defaultErrorHandler:](0x12059c) Error Domain: NSCocoaErrorDomain
2013-01-03 16:03:35.280 MyAppName[188:1503] +[MagicalRecord(ErrorHandling) defaultErrorHandler:](0x12059c) Recovery Suggestion: (null)
2013-01-03 16:03:35.296 MyAppName[188:907] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(0x3ade92a3 0x356bf97f 0x3ad33e8d 0xb3db3 0x35e3f11f 0x35e3e4b7 0x35e431bd 0x3adbcf3b 0x3ad2febd 0x3ad2fd49 0x3a4b72eb 0x36879301 0x4fa7d 0x4fa18)
libc++abi.dylib: terminate called throwing an exception
(lldb)
我读过几篇帖子说iCloud表现得很奇怪,最好只是试着等。这就是我所做的,当我今天18小时后尝试或多或少地发生同样的事情时。
首先,当我启动应用程序时,它给了我另一个错误。启动应用程序时会发生这种情况,因为我在-application:didFinishLaunchingWithOptions:
中配置了Core Data和iCloud。我收到以下错误:
-[_PFUbiquityRecordsImporter rollResponseOperation:encounteredAnError:whileTryingToAdoptBaseline:](1509): CoreData: Ubiquity: <PFUbiquityBaselineRollResponseOperation: 0x1e0b3540> localPeerID: mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C, storeName: com.mydomain.MyAppName, modelVersionHash: HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=
ubiquityRootLocation: <PFUbiquityLocation: 0x1cdb8650>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName
Encountered an error while trying to respond to the roll of baseline: <PFUbiquityBaseline: 0x1e0b4aa0>(0)
permanentLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip
safeLocation: <PFUbiquityLocation: 0x1e0b33a0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C
currentLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip
storeName: com.mydomain.MyAppName
modelVersionHash: HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=
baselineArchiveLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip
Error: Error Domain=NSCocoaErrorDomain Code=134310 "The operation couldn’t be completed. (Cocoa error 134310.)" UserInfo=0x1e0b8c40 {baseline=<PFUbiquityBaseline: 0x1e0b4aa0>(0)
permanentLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip
safeLocation: <PFUbiquityLocation: 0x1e0b33a0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C
currentLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip
storeName: com.mydomain.MyAppName
modelVersionHash: HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=
baselineArchiveLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip
, localStoreKV=<PFUbiquityKnowledgeVector: 0x1e0b90c0> ()}
userInfo: {
baseline = "<PFUbiquityBaseline: 0x1e0b4aa0>(0)\n\tpermanentLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip\n\tsafeLocation: <PFUbiquityLocation: 0x1e0b33a0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/mobile.D2EB3F30-70E9-5405-931D-B7217274BA1C\n\tcurrentLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip\n\n\tstoreName: com.mydomain.MyAppName\n\tmodelVersionHash: HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=\n\tbaselineArchiveLocation: <PFUbiquityLocation: 0x1e0ab2e0>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~mydomain~MyAppName/.baseline/com.mydomain.MyAppName/HExUvqv20os5L2c5u1DeTzBs3lEpOwzkgw1MsXYupPg=/baseline.zip\n";
localStoreKV = "<PFUbiquityKnowledgeVector: 0x1e0b90c0> ()";
}
现在,在尝试了论坛上提到的几个解决方案后(例如,清理构建,重新安装应用程序,删除iCloud数据等),我收到的错误与昨天相同。
我真的无法弄清楚为什么会这样。我不记得用iCloud配置做了什么。我已经更新了我的数据模型,但是在完成应用程序的干净安装,删除所有以前的iCloud数据后,这应该不重要。
我希望有人可以帮助我更接近发生这些错误的原因。
答案 0 :(得分:8)
现在这似乎是iCloud的一个已知问题。它一直在使用CoreData和iCloud为我的应用程序间歇工作。很多错误域= NSCocoaErrorDomain代码= 512“文件上传超时。”它可能与您的应用程序完全无关,而与iCloud服务器有关。我一直在关注开发者论坛上的一个帖子,指出它在Apple方面是错误的。 (至少自2003年12月30日以来的问题)以下是讨论: