有时候程序崩溃或者出现异常,不好找到出问题的地方。只需要设置Xcode,使其能够在程序崩溃或者出现异常的地方,主动加上断点,注意,是让Xcode主动加断点,这样可以方便我们调试
While you can set breakpoints yourself to break on a particular line,it would be nice if the debugger would automatically set a breakpoint on any line that causes your application to crash or that causes an exception to be thrown.
To get the debugger to do this, we need to add a breakpoint for all exceptions. Select the debug navigator(Figure 1).Then, at the bottom of the navigator area,click the "+" icon(Figure 2) and select "Add Exception Breakpoint..".Then, click the "Done" button on the panel that pops up (Figure 3).
Figure 1:
Figure 2:
Figure 3: