
In the lower left corner of the code window in Xcode 4, you can see the debugging controls. Each of them has a short text for explanation. I will explain here in more detail. Learning to become an expert debugger is the subject of many textbooks.
Play button Alt: Continue the program . You probably already found it. Pressing the button moves to the next breakpoint.
Arrow arrow alt: Step over . Pressing this button again will allow you to advance through your program at the current level of visibility, just like your program. This will allow you to observe the behavior of your program step by step according to the current method. When the current method completes, Step over will take you to the calling method one step up in the program stack.
Down arrow text: Step c . Pressing this button will follow the new method in its area and allow you to view the code in the called method if it was compiled for debugging. For example, clicking on the current line of code in the above debugging window will take you to the _generateSources method, which you can then follow through with a step.
Upper arrow alt text: Exit . Brings you out of the current context and into the calling method one step up in the program stack. This behaves identically to the completion of the method using Step over, executing the program as usual and executing all lines of code in the source area that you did not debug with Step over.

Click on the silhouette with a blue background to see the current call stack. The call stack will always go all the way from the current area to the first method that was called to run your program. Each method that you see here has been called sequentially to achieve - [HelloWorldLayer init]. When you click Run , then the current line of executable code will return to [CCNode node], and if you have a source for it, you can view it.
On the left are the current Local variables visible from the scope of the current line of code (line 76 in this image). These variables are how you can really use the commands above, like Step over . background and winSize are local variables that have been defined in this area and are currently in use. When the scope comes out, they disappear. _cmd is a pointer to a selector that is currently being called in Objective-C: - [HelloWorldLayer init]. You will not need this until you are an advanced debugger. self is a pointer to an object containing all ivars belonging to the executable class, HelloWorldLayer and objc_super is a pointer to the parent class HelloWorldLayer.
Thomson comer
source share