Does Not Compute, Part 1: Unsatisfiable Constraints

Because constraints are expressed as mathematical expressions and Auto Layout’s job is to solve the entire system together, you may sometimes run into situations where Auto Layout cannot solve the system. Generally this will occur if there are too many or too few constraints.

If there are too many constraints, or if the constraints conflict with each other, we say that the constraints are unsatisfiable. If this happens, the Auto Layout system will recognize it at runtime and print debug information to the console, providing you with a list of the constraints which are in conflict. (If you added your unsatisfiable constraints in Interface Builder, it would inform you of this immediately.) ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.