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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 15. Debugging

Chapter 15. Debugging

Getting your project to build is sometimes only half the battle. OK, let's be honest: It's often less than half the battle. It's a cruel fact of programming that your application will have bugs, design flaws, and unexpected behavior. Object-oriented languages, modeling, good design, rigorous coding standards, and unit testing can reduce the number of bugs that creep into your code. But unless your application is trivial, it doesn't matter how careful you've been, how many code reviews you've done, or how many "best practices" you've employed. Someday your application is simply not going to work the way you want it to, and you'll have to find out why. The tool of choice to answer that question is the debugger.

The debugger is a magic window into your application. You can literally watch the internals of your program at work. You can stop your application at any point. You can examine the values of variables, the state of other threads, and much more. Xcode even allows you alter values and fix some code while your application is still running—the equivalent of performing a heart transplant on an athlete who's in the middle of running a marathon.


  

You are currently reading a PREVIEW of this book.

                                                                                        

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

  

Start a Free Trial


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