Debugging Apps with Xcode 15: Stepping through Code With Breakpoints

Опубликовано: 06 Октябрь 2023
на канале: Cocoacasts
1,116
16

In the previous video, you learned what a breakpoint is and what types of breakpoints Xcode supports. In this video, we step through code using a breakpoint and the debug bar we explored earlier in this course.

If we run the app and the breakpoint in LocationsViewModel.swift is hit, the line of the breakpoint turns green. It indicates the location of the instruction pointer. We can inspect the stack trace, the variables view, and the output in Xcode's console. This is helpful if you are debugging an issue in your project.

But it is often useful to understand what happens next. The step controls of the debug bar allow us to do that. Earlier in this course, you learned that we can continue execution by clicking the Continue/Pause button of the debug bar. That isn't what we want, though. I would like to zoom in on the step controls on the right of the Continue/Pause button.