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?
-
This is not really a question but the AppDelegate is the first thing ran on your application so that may be why. – Jesse Onolemen Apr 06 '15 at 13:43
-
11. What is the message in the lldb pane? 2. Only enable Objective-C breakpoints. Right click on "All Exceptions, select "Edit Breakpoint", Change the popup from "All" to "Objective-C". 3. Sometimes Code "gets confused", clear all breakpoints, quit and relaunch Xcode. – zaph Apr 06 '15 at 13:54
-
Zaph, 1: the lldb pane show no message, just (lldb), 2: yeah changing to objc worked, dunno why? you can add it as answer if you want, thx you! – Godfather Apr 06 '15 at 14:09
-
2NSURLSession uses C++ exceptions for its control flow. This might be a reason why that happened. – HAS Apr 06 '15 at 15:31
3 Answers
Only enable Objective-C breakpoints.
To see the actual statement that is causing the error add an exception breakpoint:
From the Main Menu Debug:Breakpoints:Create Exception Breakpoint.
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).
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.
-
Excellent tip! Thanks. This has been driving me nuts throughout several projects. – VaporwareWolf Dec 06 '16 at 18:09
-
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:
Then check the Options box:

- 1,268
- 1
- 19
- 34
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