Adding an Exception Breakpoint - Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 25 bey

用如下的方法可以非常方便停留到具体crash的某行代码

Adding an Exception Breakpoint

Add an exception breakpoint to your project in the breakpoint navigator.

To add an exception breakpoint
  1. In the bottom-left corner of the breakpoints navigator, click the Add button.

  2. Choose Add Exception Breakpoint.

  3. In the Exception pop-up menu, choose the type of exception on which you want execution to stop:

    • All. Stops on all exceptions.

    • Objective-C. Stops on Objective-C exceptions.

    • C++. Stops on C++ exceptions.

      To stop on a particular C++ exception, specify the exception name.

  4. Choose the phase of the exception handling process at which you want program execution to stop.

  5. Click Done.

    The screenshot shows the properties of an exception breakpoint.

你可能感兴趣的:(exception)