0

当我在 iOS 模拟器中启动我的示例应用程序时,我遇到了这个问题,每当我调试时,我都会使用机器代码,所以很难找到到底是什么原因造成的nil modal view controller

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <MainViewController: 0x7f933370d740>.'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000102a46f35 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001057bbbb7 objc_exception_throw + 45
    2   UIKit                               0x0000000102f64ed3 -[UIViewController _presentViewController:withAnimationController:completion:] + 2916
    3   UIKit                               0x0000000102f66d81 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 132
    4   UIKit                               0x0000000102f66ca5 -[UIViewController presentViewController:animated:completion:] + 229
    5   Sample App Cordova                  0x00000001028148a9 -[ControllerActionHandler _presentViewController:] + 187
    6   Sample App Cordova                  0x000000010281459a -[ControllerActionHandler openCreateProfileForAuth] + 510
    7   Foundation                          0x0000000105374212 __NSThreadPerformPerform + 299
    8   CoreFoundation                      0x000000010297c551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    9   CoreFoundation                      0x000000010297241d __CFRunLoopDoSources0 + 269
    10  CoreFoundation                      0x0000000102971a54 __CFRunLoopRun + 868
    11  CoreFoundation                      0x0000000102971486 CFRunLoopRunSpecific + 470
    12  GraphicsServices                    0x0000000106f4b9f0 GSEventRunModal + 161
    13  UIKit                               0x0000000102e33420 UIApplicationMain + 1282
    14  Sample App Cordova                  0x00000001027ffb87 main + 71
    15  libdyld.dylib                       0x0000000105f2f145 start + 1
)

libc++abi.dylib:以 NSException 类型的未捕获异常终止

除了 iOS 8.1 之外,应用程序也可以正常运行

4

0 回答 0