Finding a bug using Xcode - attempt to insert nil value

前端 未结 5 651
离开以前
离开以前 2021-02-10 15:18

I am getting a random bug in my app, which is causing it to crash. The problem I am facing is XCode doesn\'t tell me where the crash is happening only the below information. Can

5条回答
  •  礼貌的吻别
    2021-02-10 15:51

    There is a solution that I usually use on my projects, setting up some special breakpoint. To do that:

    1. Open XCode
    2. Goes to "View -> Navigators -> Show Breakpoint Navigators"

    Now add some new breakpoints clicking the "+" button:

    • Add exception breakpoint
    • Add Symbolic breakpoint with symbol [NSException raise]
    • Add Symbolic breakpoint with symbol objc_exception_throw

    Run again your project, application will stop on the line that is causing your problems.

提交回复
热议问题