9 Debugging

As you write an application, you will inevitably make mistakes. Even worse, from time to time you will have errors in your application’s design. Xcode’s debugger (called LLDB) is the fundamental tool that will help you find these bugs and fix them. This chapter gives you an overview of Xcode’s debugger and its basic functions.

A Buggy Project

You will use a simple project to guide you through your exploration of the Xcode debugger. Open Xcode and create a new project for an iOS single view application. Name the project Buggy and make sure Language is set to Swift, Devices is set to iPhone, and Use Core Data, Include Unit Tests, and Include UI Tests are all unchecked (Figure 9.1). Click Next.

Figure 9.1  Configuring ...

Get iOS Programming: The Big Nerd Ranch Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.