Browse Questions
- LLDB is the debugger built into Xcode.
- A memory leak is memory that is allocated but never freed — usually from retain cycles.
- Swift's async/await is directly supported in XCTest — mark your test function as async throws and await the result.
- Classic OOP centers on classes and inheritance hierarchies — behavior is shared by subclassing a base class.
Answer: LLDB is the debugger built into Xcode. When paused at a breakpoint, you can type commands in the console to inspect and modify the running app.
Most useful commands:
# Print object description
po viewModel
po viewModel.items.count
# Print raw value
p frame.size.width
# Modify a value while paused
expr isLoading = true
expr (void)[self.tableView reloadData]
# Print backtrace (call stack)
bt
# Move up/down the call stack
up
down
# List all local variables
frame variable
# Continue execution
c
# Step over next line
n
# Step into function call
s
# Step out of current function
finish
# Set a breakpoint from console
breakpoint set --name viewDidLoad
br s -n "URLSession"