Book Image

Objective C Memory Management Essentials

Book Image

Objective C Memory Management Essentials

Overview of this book

Table of Contents (18 chapters)
Objective-C Memory Management Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using the debugger and breakpoints


One of the most fundamental debugging concepts of using an IDE, such as Xcode, is the concept of breakpoints, where you can stop your running program at a particular point in time as denoted by the breakpoint where your code is. Using the breakpoint is very simple; you just open up your Xcode project and click on the left side of the window where you code it and a blue indicator will appear, as shown here:

Next, when you run your application and when the program hits line number 26 at the while(true) statement, the program will halt and you can move your cursor over any variable before line number 26, and Xcode will show you the value that the variable contains at that point in time. Breakpoints are useful in debugging memory leaks where you have an idea of where a leak appears and you want to see the value or memory address of that variable. You can put multiple breakpoints and use the Step Over command to step over each line of code to see how your program...