I am building an app in Xcode 9 (Swift 4) and it crashes before it even loads completely. I get an error: Thread 1: Signal SIGABRT
and libc++abi.dylib: terminating with uncaught exception of type NSException
. How do I know which line of code is causing the error using breakpoints and debugging? Any help would be appreciated. Thanks!
(Here's a screenshot as well)
这里你需要的是一个异常断点。异常断点是一种特殊的断点,每当发生异常时就会中断,而不是每次都在特定文件的特定行上中断。断点中断的行就是引发异常的行。要设置异常断点,您需要打开断点导航器并按+
左下角的按钮
将会弹出一个小菜单,您可以从中选择Exception Breakpoint…
之后可能会弹出第三个菜单,但您只需单击其外部的任意位置即可将其关闭。之后,当您再次构建并运行您的应用程序时,只要在抛出该应用程序的行上抛出异常,它就会中断
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)