Search code examples
iosexceptioncore-animation

How can I make CoreAnimation not ignore exceptions during animation?


Currently CoreAnimation ignores exception during animation, so my assertion code doesn't work. How can I make CoreAnimation not to ignore exception during animation and stop the program execution to debug?


Solution

  • If your main objective is just to halt the program as soon as an exception is thrown, I would recommend setting a break point on objc_exception_throw. In Xcode 3.2 you can do this by selecting "Stop on Objective-C Exceptions" under the Run menu. You can also do this: How to add a breakpoint to objc_exception_throw?

    If you're using Xcode 4, just expand the breakpoints panel on the left, hit the plus sign at the bottom, and select Add Exception Breakpoint.

    The breakpoint approach is helpful in general in case there may be other things besides CoreAnimation that catch exceptions and do their own thing.