Is it possible to set the breakpoint in Xcode to have the debugger stop only on unrecognized selector?
I have other exceptions that are triggering, and I only want to trigger on the unrecognized selector
exception, nothing else.
Navigate to a line in your code where you want execution to pause, then click the gutter or line number in the source editor to set a breakpoint. Xcode displays a breakpoint icon to indicate the location. Drag a breakpoint up or down to move it to another location; drag it away from the gutter to remove it.
An exception breakpoint is a type of breakpoint that is created when some exception occurs in the code. On occurrence of such exception our application stops at that given condition causing the exception and we can access all variables in scope at that breakpoint.
It allows you to add a symbolic breakpoint which will halt the execution at a specific point so that you can backtrack and start investigating into where this method call was triggered.
Swift version: 5.6. Breakpoints are locations in your code where Xcode will pause so that you can inspect the state of your program. They don't have any impact on the final performance of your code – in fact, they don't even exist in your code at all – so there's no harm using them liberally.
Setting a symbolic breakpoint for -[NSObject doesNotRecognizeSelector:]
should do the trick.
In Xcode 4, press cmd
+6
to go to the Breakpoint Navigator, then click the +
and choose "Add Symbolic Breakpoint…". Configure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With