If i change the size of NSToolbar from application, via small size, icons & text, the app brakes on unsatisfied constraints (tried to turn off autolayout, or let the app generate its layout)
My window consist of a toolbar and a (left / right) split view inside
[81687:303] Unable to simultaneously satisfy constraints:
(
"<NSAutoresizingMaskLayoutConstraint:0x100635620 h=--& v=--& V:[NSToolbarItemViewer:0x101b4d930(5)]>",
"<NSAutoresizingMaskLayoutConstraint:0x100634b30 h=--& v=-&- V:|-(11)-[_NSToolbarSpace:0x101b49a00] (Names: '|':NSToolbarItemViewer:0x101b4d930 )>",
"<NSAutoresizingMaskLayoutConstraint:0x100634ad0 h=--& v=-&- V:[_NSToolbarSpace:0x101b49a00]-(12)-| (Names: '|':NSToolbarItemViewer:0x101b4d930 )>"
)
Will attempt to recover by breaking constraint
<NSAutoresizingMaskLayoutConstraint:0x100634b30 h=--& v=-&- V:|-(11)-[_NSToolbarSpace:0x101b49a00] (Names: '|':NSToolbarItemViewer:0x101b4d930 )>
Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.
When i visualize the constraint error
Edit : Looks like "Toolbar Space Item" is breaking the constraint, if i remove it, i runs fine
Looks like a bug, i ended up adding my own space item, using a blank NSView
I had a similar problem. And what fixed the problem for me was removing all flexible spaces from both the Default Toolbar and the Allowed Toolbar Items. When I added the Flexible Space again from the object browser the warning disappeared.
In my Git diff I see that the structure seems to have changed somewhat:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With