I've been experimenting with Xcode's Constraint Error breakpoint, but it's not being hit when the project contains Auto Layout issues. The outpout in Xcode's console clearly indicates the user interface has conficting constraints and the debugger suggests to add a symbolic breakpoint, but the Constraint Error breakpoint itself isn't being hit. Is this a known issue or am I overlooking something?
You can see what these ‘magic’ breakpoints do under the covers by using LLDB’s
breakpoint list
command. For example, after setting a Constraint Error breakpoint I see this:
(lldb) br list
Current breakpoints:
1: name = 'LAYOUT_CONSTRAINTS_NOT_SATISFIABLE', locations = 0 (pending)
Note that the
locations
value is 0, indicating that the breakpoint hasn’t been resolved to any actual locations. Clearly it’s not going to be effective in that case.
The above was on iOS (11, in the simulator). When I run the same test on macOS (10.13) I see this:
(lldb) br list
Current breakpoints:
1: name = 'LAYOUT_CONSTRAINTS_NOT_SATISFIABLE', locations = 1, resolved = 1, hit count = 0
1.1: where = AppKit`LAYOUT_CONSTRAINTS_NOT_SATISFIABLE, address = 0x00007fff28d130b1, resolved, hit count = 0
It seems like this is an AppKit-specific feature. Are you testing this on iOS? If so, that explains why you’re not getting any hits.
You wrote:
The outpout in Xcode's console clearly indicates the user interface has conficting constraints and the debugger suggests to add a symbolic breakpoint …
What exactly does it say?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"