23.2 · The view debugger, network inspection and memory bugs

Some bugs are about what is on screen, some about what the network really sent, and some about memory that was freed while someone still held it. Each has a tool that shows the thing directly.

Mental model. Look at the actual state (the real view tree, the real request, the real object) instead of inferring it from code.

What is on screen and on the wire

The view debugger and network inspection.

  1. How do you debug layout and views with the view debugger, and how do you inspect what your app really sends over the network? 23.2.1 · L3
    The view debugger (Xcode’s Debug View Hierarchy) captures the live view tree and lets you explode it in 3D, click any view and read its frame, constraints…

Memory that goes wrong

Zombies, malloc stack logging and dangling references.

  1. What are zombie objects and malloc stack logging, and how do you debug dangling references and over-released memory? 23.2.2 · L3
    Swift’s ARC prevents most lifetime bugs, but a dangling reference can still exist: an Objective-C object over-released through manual retain-release or a bad…

More in Debugging & Instruments