Petras
Petras

Reputation: 4759

How do you add a breakpoint in Xcode?

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.

Upvotes: 11

Views: 9699

Answers (4)

vikingosegundo
vikingosegundo

Reputation: 52227

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

Upvotes: 5

user5338646
user5338646

Reputation: 101

Command + \ to add breakpoint at current line

Upvotes: 10

sdjuan
sdjuan

Reputation: 719

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

that menu also shows the shortcuts for similar actions

Upvotes: 2

SashaZd
SashaZd

Reputation: 3319

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

Upvotes: 6

Related Questions