我在应用程序商店中有一个应用程序,并且有一个崩溃报告显示有一个非常偶然的崩溃,详情如下:
Incident Identifier: C25BD8DF-FAA9-4A5F-B3D2-6E1CE81F1D17 CrashReporter Key: 798f7dee81117ed0f05b3f19dc4bbc2874eefaf6 Hardware Model: iPhone9,2 Process: My app [1936] Path: /private/var/containers/Bundle/Application/757D7BE6-4F91-4B74-BA64-09FA53AE3E16/My app.app/My app Identifier: com.app.Myapp Version: 12 (1.1) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.app.Myapp [701] Date/Time: 2017-06-27 20:05:28.7901 -0400 Launch Time: 2017-06-27 16:38:23.0376 -0400 OS Version: iPhone OS 10.3.2 (14F89) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010 Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL,Code 0xb Terminating Process: exc handler [0] Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 UIKit 0x0000000190ee4264 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 444 (UIPresentationController.m:731) 1 UIKit 0x0000000190ee4260 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 440 (UIPresentationController.m:731) 2 UIKit 0x0000000190e20950 _runAfterCACommitDeferredBlocks + 292 (UIApplication.m:2469) 3 UIKit 0x0000000190e129ec _cleanUpAfterCAFlushAndRunDeferredBlocks + 528 (UIApplication.m:2447) 4 UIKit 0x0000000190b86648 _afterCACommitHandler + 132 (UIApplication.m:2499) 5 CoreFoundation 0x000000018aa109a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1802) 6 CoreFoundation 0x000000018aa0e630 __CFRunLoopDoObservers + 372 (CFRunLoop.c:1898) 7 CoreFoundation 0x000000018aa0ea7c __CFRunLoopRun + 956 (CFRunLoop.c:2849) 8 CoreFoundation 0x000000018a93eda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113) 9 GraphicsServices 0x000000018c3a8074 GSEventRunModal + 100 (GSEvent.c:2245) 10 UIKit 0x0000000190bf9058 UIApplicationMain + 208 (UIApplication.m:4089) 11 My app 0x000000010005a8b4 main + 56 (Database.swift:17) 12 libdyld.dylib 0x000000018994d59c start + 4
我的应用程序不使用UIPresentationController,为什么这显示为线程0中的最后一行是崩溃的线程?
解决方法
如果不仔细查看您的代码,这很难回答.通常,您应该检查可能忽略的可能类(包括系统框架)实际上是UIPresentationController的子类.此外,第三方库可能正在引用此类(或子类).
但最有可能的是,这是UIKit的崩溃. UIPresentationController是一个提供高级视图控制器管理并处理控制器之间转换的类.最有可能的是,UIKit在某处崩溃(很可能是由于你的代码).更多信息在Apple docs.