Breaking into the debugger on iPhone

后端 未结 8 1275
花落未央
花落未央 2020-12-15 07:23

For assert macros in my iPhone project, I\'m looking for a way to programmatically break into the debugger. On Windows (MSVC++), I can use __debugbreak() for this purpose. I

8条回答
  •  抹茶落季
    2020-12-15 07:52

    If you run your program in debug, your app should launch the debugger when it reaches an invalid assertion.

    For it to stop, as Jens Alfke tried to say, you need to enable "Stop on Objective-C Exceptions" (under the Run menu).

    For more info about debugging vs. releasing and asserts, read http://myok12.wordpress.com/2010/10/10/to-use-or-not-to-use-assertions/

提交回复
热议问题