Is the "Add Missing Constraints" function in the Xcode User Interface Builder known to work properly, or should this functionality be avoided?
Conceptually, constraints make perfect sense. Each element is declared as having a behaviour relative to other elements, allowing the layout to be calculated automatically. In my case I have a number of elements, and each element needs to be rendered below the previous one. So far makes sense.
In practice, adding constraints is very hit and miss. No matter how carefully I add the constraints by hand, I get warnings "height is ambiguous" or "vertical position is ambiguous", but none of these messages are ever specific enough to explain what's actually wrong.
Eventually you select the "Add Missing Constraints" option, and at this point chaos is unleashed. Constraints are added between elements that have no obvious relation to one another. The third element down immediately gains a constraint relative to the top of the window, for no obvious reason. Constraints suddenly have constants added, none of which make any sense. Elements are now off the screen, with no obvious explanation.
At this point the constraints are wrecked, and the UI has to be redeveloped from scratch.
My question is this: Is there a specific technique that should be used to handle constraints when building a UI? Is there a special order things should be done in? Should the UI be avoided and all constraints be declared programmatically?
The user interface is supposed to be the Mac's core strength. I can't see how any user interface gets developed with tools this unfinished. Can anyone shed any light of how to approach practical UI design on the Mac?
Conceptually, constraints make perfect sense. Each element is declared as having a behaviour relative to other elements, allowing the layout to be calculated automatically. In my case I have a number of elements, and each element needs to be rendered below the previous one. So far makes sense.
In practice, adding constraints is very hit and miss. No matter how carefully I add the constraints by hand, I get warnings "height is ambiguous" or "vertical position is ambiguous", but none of these messages are ever specific enough to explain what's actually wrong.
Eventually you select the "Add Missing Constraints" option, and at this point chaos is unleashed. Constraints are added between elements that have no obvious relation to one another. The third element down immediately gains a constraint relative to the top of the window, for no obvious reason. Constraints suddenly have constants added, none of which make any sense. Elements are now off the screen, with no obvious explanation.
At this point the constraints are wrecked, and the UI has to be redeveloped from scratch.
My question is this: Is there a specific technique that should be used to handle constraints when building a UI? Is there a special order things should be done in? Should the UI be avoided and all constraints be declared programmatically?
The user interface is supposed to be the Mac's core strength. I can't see how any user interface gets developed with tools this unfinished. Can anyone shed any light of how to approach practical UI design on the Mac?