How to display the exact line of code causing application crash in xcode 4 debugger like in xcode 3.2

戏子无情 提交于 2019-12-21 03:43:14

问题


I just downloaded xcode 4 recently and have read the xcode transition guide, however, I am still wondering how do I get the same feature for debugger in xcode 4 like in xcode 3.2.

When I program in xcode 3.2 and run my application, if my code happened to cause a crash in the program, I could just press command+shift+y and I'll get the debugger mode appearing, which will shows which lines that it crashes. However, I can't seem to get this working for xcode 4.

I know that I can look at which line that actually causes the crash by looking at the stacktrace, however, having that functionality in xcode 3.2 really saves me time. Just wondering if anyone knows how to do this in xcode 4 as well.


回答1:


You need to add an exception breakpoint. Select the Breakpoint Navigator, click the Add (+) button at the bottom, then choose Add Exception Breakpoint... This should cause the debugger to pause any time it encounters an exception. Note, you have to have the Breakpoints button enabled (to the right of the Scheme selector in the toolbar). Note also, in Xcode 4, Run with breakpoints enabled is synonymous with "Build and Debug" in previous versions.



来源:https://stackoverflow.com/questions/5453859/how-to-display-the-exact-line-of-code-causing-application-crash-in-xcode-4-debug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!