Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you watch a variable in xcode 4?

How do you watch a variable in xcode 4? I'm not sure how to do this.

like image 942
lampShade Avatar asked May 12 '11 17:05

lampShade


People also ask

How do I see variables in Xcode?

We can show or hide the variables view and the console by clicking the middle view control at the top right or by clicking the leftmost button of the debug bar. The variables view is empty at the moment because the application isn't paused.

What is a watch variable?

Any item of data within a program that a programmer wants to observe when debugging. Watch variables may be viewed while the program runs on its own, is stepped through instruction by instruction or when the program crashes. Setting watch variables is part of the debugging operation in a compiler.

How do I trace in Xcode?

Use the bt command in (lldb). Once paused or after a crash, just type bt into the debug console. It will print the full stack trace. Awesome tip for tracking down a constraint issue after setting the symbolic breakpoint.


2 Answers

Right click in the local variables window to see the "Watch Expression" menu command. Type the variable name and the variable will be added.

like image 70
jbierling Avatar answered Oct 02 '22 14:10

jbierling


"Watch VariableName" is available in debug area. Just right click on a var and select "Watch var".

enter image description here

like image 42
DareDevil Avatar answered Oct 02 '22 14:10

DareDevil