Creating breakpoint in Xcode for unrecognized selector

AWF4vk picture AWF4vk · Aug 23, 2011 · Viewed 8.5k times · Source

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.

Answer

justin picture justin · Aug 23, 2011

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.