Always stop in App delegate after enabling All exceptions break point

后端 未结 3 1227
攒了一身酷
攒了一身酷 2020-12-08 09:43

When i enable all exceptions breakpoint my app always stops in AppDelegate, but im able to continue the program execution, but its very annoying cause always takes me to the

相关标签:
3条回答
  • 2020-12-08 10:16

    If you're using Swift, or you want to have all the exceptions captured, you can change an option on All Exceptions to automatically continue after evaluating actions. Just find it in the Breakpoint Navigator and right/ctrl click the all Exceptions Breakpoint to edit it: enter image description here

    Then check the Options box: enter image description here

    0 讨论(0)
  • 2020-12-08 10:24

    Exceptions in C++ code common and normal. The exception breakpoint catches every raised exception even when they are being handled correctly. So if you don't specify Obj-C only you will notice that execution stops in a lot of seemingly random places. I run into this all the time with AVAudioPlayer especially.

    Another thing to look out for are missing assets. I came across this question from another asker who seems to have also run into the same issue.

    Xcode throws an exception in Main() in iOS 8 with 'all exceptions' breakpoint

    0 讨论(0)
  • 2020-12-08 10:29

    Only enable Objective-C breakpoints.

    To see the actual statement that is causing the error add an exception breakpoint:

    1. From the Main Menu Debug:Breakpoints:Create Exception Breakpoint.

    2. Right-click the breakpoint and set the exception to Objective-C. This will ignore other types of exceptions such as from C++. There are parts of the APIs that use exceptions such as Core Data (Apple is Special).

    3. Add an action: "po $arg1".

    Run the app to get the breakpoint and you will be at the line that causes the exception and the error message will be in the debugger console.

    Breakpoint example:

    0 讨论(0)
提交回复
热议问题