Topics

#6: Debugging Tips 🐞

Topics

Today we'll take a look at a few handy tips and tricks to know about when debugging.

Exception Breakpoint

Make sure to always add an exception breakpoint to every project. Xcode will pause anytime an exception is thrown and let us poke around.

Image 1 of 4 from bite #6: Debugging Tips

Conditional Breakpoints

Break exactly when we want to.

Image 2 of 4 from bite #6: Debugging Tips

Evaluate an Expression

With expression or e we can even modify values in our app, and then continue running.

Image 3 of 4 from bite #6: Debugging Tips

Property Breakpoints

Here's one that is not as widely known as it should be:

Image 4 of 4 from bite #6: Debugging Tips

If we set a breakpoint on the line of code containing a property definition, our application will pause anytime that property's value is changing and display a stack trace of the function calls that ultimately caused the change.