我注意到,当应用程序在iOS 11上崩溃时,一些异常,比如NSGenericException或NSManagedObject异常,在输出中不会包含太多细节。但同时,如果我在iOS 9或10上运行并使其崩溃,它将包含许多有用的细节。
例如。同样的应用,同样的崩溃,在iOS 11上:
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 在iOS 9-10:
2018-01-02 23:51:22.967 CafeManager[3726:130232] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIAlertController (<UIAlertController: 0x7f959a7634c0>) of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f61eb0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010ec6f141 objc_exception_throw + 48
2 UIKit 0x0000000110c04d67 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3291
3 UIKit 0x00000001102ac3c2 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2278
4 UIKit 0x00000001102a9d20 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 426
5 UIKit 0x0000000110137853 _runAfterCACommitDeferredBlocks + 318
6 UIKit 0x000000011012481c _cleanUpAfterCAFlushAndRunDeferredBlocks + 532
7 UIKit 0x0000000110156560 _afterCACommitHandler + 137
8 CoreFoundation 0x000000010f5c4717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
9 CoreFoundation 0x000000010f5c4687 __CFRunLoopDoObservers + 391
10 CoreFoundation 0x000000010f5a9720 __CFRunLoopRun + 1200
11 CoreFoundation 0x000000010f5a9016 CFRunLoopRunSpecific + 406
12 GraphicsServices 0x0000000114cc1a24 GSEventRunModal + 62
13 UIKit 0x000000011012b134 UIApplicationMain + 159
14 CafeManager 0x000000010dd37747 main + 55
15 libdyld.dylib 0x0000000113d1c65d start + 1
16 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 正如你所看到的,这真的很重要。我错过了什么?是否有任何调试器设置或与iOS 11相关的问题?
更新:在Apple开发者论坛和Apple Bug记者上提出了同样的问题。到目前为止还没有答案。
发布于 2018-02-12 16:30:57
您是否碰巧设置了OS_ACTIVITY_MODE变量?
要检查是否设置了此变量(并将其关闭),请在Xcode 9中执行以下操作:
从Xcode菜单选择产品->方案->编辑方案。选择运行方案并在参数下查看。如果您看到选中了OS_ACTIVITY_MODE变量,请取消选择它。
https://stackoverflow.com/questions/48067747
复制相似问题