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.
- How do you debug layout and views with the view debugger, and how do you inspect what your app really sends over the network?
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.
- What are zombie objects and malloc stack logging, and how do you debug dangling references and over-released memory?
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
- 23.1 · LLDB and breakpoints
- 23.3 · Sanitizers, and bugs that only appear in Release
- 23.4 · Unified logging: Logger, levels, privacy and reading logs back
- 23.5 · Crash reports, symbolication and a production diagnostics pipeline
- 23.6 · Console, sysdiagnose and reproducing a bug
- 23.7 · Schemes, test plans, simulators and derived data
- 23.8 · Reading sanitizer output, exit codes and runtime traps
- 23.9 · Diagnosing a hang, malloc debugging and leaks from the command line
- 23.10 · Demangling, atos and empty dSYMs, and log formatting