Xcode 4 exception breakpoint filtering

2020-04-07 19:00发布

问题:

Breaking on Objective-C exceptions is really useful and easily the best way to debug issues with NSArray and the like. However, exceptions are also a great thing to use while actually programming.

Xcode offers two choices for breaking on Obj-C exceptions:

  • Break whenever an exception is thrown
  • Break whenever an exception is caught

Breaking on catch seems to be basically useless, since the point of @throw is a lot more important. However, if I'm handling an exception fine, I don't want my program to stop.

So, the ideal situation would be: break on all exceptions that are not caught by my code, but show a stack trace for when the exception was thrown.

Another decent solution would be some sort of debugging whitelist for exceptions that should not be broken on.

Is there any way to filter exception breakpoints?