11

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.

4
  • 7
    Shortcut: Insert cursor on the line you want, then hit "Command + \". Commented Feb 8, 2011 at 10:40
  • Or just click in the left edge window border next to the required line. Commented Feb 8, 2011 at 10:52
  • As I just learned from the docs I linked, the edge is called Gutter Commented Feb 8, 2011 at 10:58
  • Is there a keyboard shortcut that works on a non-english keyboard? Commented Dec 14, 2021 at 9:37

4 Answers 4

10

Command + \ to add breakpoint at current line

Sign up to request clarification or add additional context in comments.

Comments

6

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)

I'll be addressing a section on breakpoints in my blog ( http://techtalktone.wordpress.com ) soon.

Hope this helps :D

Comments

5

Maybe this is useful for you: Xcode Debugging Guide enter image description here

1 Comment

enabling line numbers shouldn't be necessary
2

use menu entry Product->Debug->Add Breakpoint at Current line

that menu also shows the shortcuts for similar actions

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.