How to get source code line from stack trace in obj-c / ios

后端 未结 4 1411
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 06:31

I use NSSetUncaughtExceptionHandler to print the stack trace to local file in iPhone, which will be sent to our server next time the app launches. Then I can examin

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-05 06:42

    I strongly recommend enabling Exception Breakpoint in Xcode. It will stop execution of your code on the exact line which crashes your application. So you do not need to worry about which of the array cause of the crash. *** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array

    Adding exception breakpoint

    1. Go to Breakpoints section on Xcode
    2. Click on plus sing at bottom of the section
    3. Select Add Exception Breakpoint

    Exception BreakPoint

提交回复
热议问题