Objective c 我的应用程序状态还原无法与iCloud一起使用
我在app store中有一个应用程序,我使用iCloud backup进行更新,并使用我的应用程序状态恢复 问题是在我将i云备份添加到我的应用程序后,我的状态恢复停止工作,每次我尝试保存应用程序状态时,它都会使应用程序崩溃 有人能帮我吗 例外情况是Objective c 我的应用程序状态还原无法与iCloud一起使用,objective-c,xcode,core-data,icloud,Objective C,Xcode,Core Data,Icloud,我在app store中有一个应用程序,我使用iCloud backup进行更新,并使用我的应用程序状态恢复 问题是在我将i云备份添加到我的应用程序后,我的状态恢复停止工作,每次我尝试保存应用程序状态时,它都会使应用程序崩溃 有人能帮我吗 例外情况是 2014-12-06 19:43:42.062 List Move[1568:560383] Exception occurred restoring state nil is not a valid object ID 2014
2014-12-06 19:43:42.062 List Move[1568:560383] Exception occurred restoring state nil is not a valid object ID
2014-12-06 19:43:42.066 List Move[1568:560383] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'nil is not a valid object ID'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109715f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001093aebb7 objc_exception_throw + 45
2 CoreData 0x00000001078ec8e5 -[NSManagedObjectContext objectWithID:] + 741
3 List Move 0x00000001074beca9 -[PatientsTableView indexPathForElementWithModelIdentifier:inView:] + 377
4 UIKit 0x0000000107d538b0 -[UITableView decodeRestorableStateWithCoder:] + 931
5 UIKit 0x0000000107c73a31 _restoreStateForViewAndSubviews + 272
6 UIKit 0x0000000107c72f46 ___restoreState_block_invoke + 793
7 UIKit 0x0000000107cc85ce +[UIView(Animation) performWithoutAnimation:] + 65
8 UIKit 0x0000000107c725f8 -[UIApplication(StateRestoration) _restoreApplicationPreservationStateWithSessionIdentifier:beginHandler:completionHandler:] + 5416
9 UIKit 0x0000000107c6f05f -[UIApplication(StateRestoration) _doRestorationIfNecessary] + 184
10 UIKit 0x0000000107c5243a -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 175
11 UIKit 0x0000000107c52fbc -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2463
12 UIKit 0x0000000107c55d2c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1350
13 UIKit 0x0000000107c54bf2 -[UIApplication workspaceDidEndTransaction:] + 179
14 FrontBoardServices 0x000000010bc3d2a3 __31-[FBSSerialQueue performAsync:]_block_invoke + 16
15 CoreFoundation 0x000000010964b53c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
16 CoreFoundation 0x0000000109641285 __CFRunLoopDoBlocks + 341
17 CoreFoundation 0x0000000109641045 __CFRunLoopRun + 2389
18 CoreFoundation 0x0000000109640486 CFRunLoopRunSpecific + 470
19 UIKit 0x0000000107c54669 -[UIApplication _run] + 413
20 UIKit 0x0000000107c57420 UIApplicationMain + 1282
21 List Move 0x00000001074d9933 main + 115
22 libdyld.dylib 0x000000010a14f145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
您是否检查过您的
[PatientsTableView indexPathForElementWithModelIdentifier:inView:+377
是否按照异常所示的ID给出了nil?是的,我有,我不知道为什么它的行为是这样的,并且不能正确使用iCloud。错误非常清楚。答案取决于从何处获取要恢复的对象ID。它被保存在哪里,什么时候?尝试恢复值的代码是什么样子的?您需要编辑您的问题以提供更多细节,因为iCloud本身显然不会导致此错误。