I agree with other posters that Xcode as an evolving environment should include an easy way to debug variables. Well, good news, there is one!
After searching and not having a simple answer / tutorial on how to debug variables in Xcode, I went on to research with Xcode itself and found this (at least for me) a very useful discovery.
How to easily debug variables in Xcode 4.6.3
On the Xcode main screen, make sure you see the bottom debug area by clicking the top corner button shown in the screenshot.


Now set a breakpoint - the line in the code where you want to pause your program by clicking on the border of your code area.

Now in the debug area, find these buttons and click on the center in the middle. You will notice that your area is now divided into two parts.


Now run the application.
When the first breakpoint is reached during the execution of your program, you will see on the left side all of your variables available at that breakpoint.

You can expand the left arrow on a variable for more detail. And even use the search box to isolate this variable that you want and see how it changes in real time when you โenterโ the breakpoint area.

On the right side of the debugging area, you can send to print the variables as you wish, using the right-click on the desired variable.

As you can see, this context menu is filled with very interesting debugging options. For example, Watch, which has already been proposed using typed commands, or even Edit Value ..., which changes the runtime value of your variable!
Ok, hope this helped you. Please vote!
Lex L. Jul 23 '13 at 17:05 2013-07-23 17:05
source share