I recently bumped into a few new debugging features in Xcode 4 while looking at breakpoint options. To show how this works, let’s look at a small block of code where I’ve already set a breakpoint by clicking in the margin area on the left side in the editor:
![bp3](http://iphonedevelopertips.com/wp-content/uploads/2011/11/bp3.gif)
With a breakpoint set, right click (or control-click) on the breakpoint indicator, the blue area shown below in the screenshot below:
![bp1](http://iphonedevelopertips.com/wp-content/uploads/2011/11/bp1.gif)
The popup dialog below will be shown, select Edit Breakpoint:
![bp2](http://iphonedevelopertips.com/wp-content/uploads/2011/11/bp2.gif)
At this point you will be shown the dialog below. I configured the settings to only trigger the breakpoint if the value of counter is > 2. When this occurs, a message will be spoken that indicates the breakpoint name and hit count (how many times the breakpoint has been activated).
![bp4](http://iphonedevelopertips.com/wp-content/uploads/2011/11/bp4.gif)
The above is just one of many options for triggering and configuring breakpoint settings. When you get a chance, I recommend you take a few minutes to get familiar with the options for managing breakpoints. And who knows, the voice response may come in handy for those times when you are looking crossed-eyed at the screen from endless hours of coding…
没有评论:
发表评论