Skip to Content
Beginning Xcode®
book

Beginning Xcode®

by James Bucanek
April 2006
Beginner
623 pages
17h 3m
English
Wrox
Content preview from Beginning Xcode®

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.

Running an Application

Before getting into debugging, this section covers the trivial case of simply running your application. You can launch your program, more or less as it would be launched from the Finder or shell, using either the Debug

These two commands are also accessible via your toolbar in the form of the Run button ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
Native Mobile Development

Native Mobile Development

Shaun Lewis, Mike Dunn
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally

Publisher Resources

ISBN: 9780471754794Purchase book