xcode 你如何在Xcode中添加断点?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4931959/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do you add a breakpoint in Xcode?
提问by Petras
I have written my first Hello World Objective C program. How do I add a breakpoint and inspect a variable? I can see a Breakpoints button but can't insert one.
我已经编写了我的第一个 Hello World Objective C 程序。如何添加断点并检查变量?我可以看到一个 Breakpoints 按钮,但无法插入。
采纳答案by vikingosegundo
Maybe this is useful for you: Xcode Debugging Guide
也许这对你有用:Xcode Debugging Guide
回答by SashaZd
You don't need to right click or any such thing. To enable the breakpoints in your code all you have to do is click on a particular line number. You'll get a breakpoint symbol in your code there.
您不需要右键单击或任何此类操作。要在代码中启用断点,您只需单击特定的行号。你会在你的代码中得到一个断点符号。
You can add multiple breakpoints to your code. The breakpoints button on top is used to put all your breakpoints ON (during debugging) or OFF (when necessary)
您可以在代码中添加多个断点。顶部的断点按钮用于将所有断点设置为 ON(在调试期间)或 OFF(在必要时)
I'll be addressing a section on breakpoints in my blog ( http://techtalktone.wordpress.com) soon.
我很快就会在我的博客 ( http://techtalktone.wordpress.com) 中讨论一个关于断点的部分。
Hope this helps :D
希望这会有所帮助:D
回答by user5338646
Command + \ to add breakpoint at current line
Command + \ 在当前行添加断点
回答by sdjuan
use menu entry Product->Debug->Add Breakpoint at Current line
使用菜单项Product-> Debug-> Add Breakpoint at Current line
that menu also shows the shortcuts for similar actions
该菜单还显示了类似操作的快捷方式