Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Always stop in App delegate after enabling All exceptions break point

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 appdelegate. Any ideas why?

enter image description here

like image 382
Godfather Avatar asked Apr 06 '15 13:04

Godfather


3 Answers

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:

like image 167
zaph Avatar answered Nov 20 '22 00:11

zaph


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

like image 21
Bryan Cimo Avatar answered Nov 20 '22 00:11

Bryan Cimo


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

like image 4
Dare Avatar answered Nov 20 '22 00:11

Dare