Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 23. Working with the Debugger > Using Smart Breakpoints

Using Smart Breakpoints

Several times in this book you have seen how to set breakpoints; you click in the gutter of the Xcode editor next to the line on which you want to break. As shown in Figure 23.2, just before that line is executed, the debugger appears and shows you the current values of variables. (The warning message on the unused variable is due to the fact that it is, indeed, unused. In a real section of code it would be used.)

Image

Figure 23.2. Using a breakpoint.

Enhancing Breakpoints with Messages

You can edit a breakpoint to provide more information and to control how it behaves.


Try It Yourself: Edit a Breakpoint

Here are the basic steps to use to edit a breakpoint.

1. Set a breakpoint. In this case, set it on the last line of the method shown in Figure 23.2 (that is, set it on the line with }).


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint