In this chapter, we will cover the following topics:
Breakpoints
Console
Debug view hierarchy
Data tips and quick look
Debug gauges
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you are as clever as you can be when you write it, how will you ever debug it? | ||
--Brian Kerninghan |
No one writes code with the intention of introducing bugs. However, there are situations where despite the best intentions our worst nightmare comes true—the code crashes. Even with the new advancements that check for code issues and type-safe code, to make a long story short, even then bugs can creep in and cause crashes. Crashes and bugs are not just code errors; they could be missing or unreferenced libraries. There could also be a case where you might be attempting to optimize your code. Debugging provides you with a way to go through your code, and Apple has a whole heap of tools and utilities to help you achieve this task.