2

我正在尝试使用从选定索引中删除一个项目,

[toolbar removeItemAtIndex:9];

这给了我这个

Unable to simultaneously satisfy constraints:
(
    "<NSAutoresizingMaskLayoutConstraint:0x600000287f30 h=--& v=--& V:[NSToolbarItemViewer:0x10040b290(5)]>",
    "<NSAutoresizingMaskLayoutConstraint:0x600000287d00 h=--& v=-&- V:|-(10)-[_NSToolbarSpace:0x60000015b280]   (Names: '|':NSToolbarItemViewer:0x10040b290 )>",
    "<NSAutoresizingMaskLayoutConstraint:0x600000287cb0 h=--& v=-&- V:[_NSToolbarSpace:0x60000015b280]-(11)-|   (Names: '|':NSToolbarItemViewer:0x10040b290 )>"
)

Will attempt to recover by breaking constraint 
<NSAutoresizingMaskLayoutConstraint:0x600000287d00 h=--& v=-&- V:|-(10)-[_NSToolbarSpace:0x60000015b280]   (Names: '|':NSToolbarItemViewer:0x10040b290 )>

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.
2013-12-11 17:50:00.399 13+ Maths[1123:303] Unable to simultaneously satisfy constraints:
(
    "<NSAutoresizingMaskLayoutConstraint:0x600000288d90 h=--& v=--& V:[NSToolbarItemViewer:0x10040bc10(5)]>",
    "<NSAutoresizingMaskLayoutConstraint:0x600000288b60 h=--& v=-&- V:|-(10)-[_NSToolbarSpace:0x60000015b330]   (Names: '|':NSToolbarItemViewer:0x10040bc10 )>",
    "<NSAutoresizingMaskLayoutConstraint:0x600000288b10 h=--& v=-&- V:[_NSToolbarSpace:0x60000015b330]-(11)-|   (Names: '|':NSToolbarItemViewer:0x10040bc10 )>"
)

Will attempt to recover by breaking constraint 
<NSAutoresizingMaskLayoutConstraint:0x600000288b60 h=--& v=-&- V:|-(10)-[_NSToolbarSpace:0x60000015b330]   (Names: '|':NSToolbarItemViewer:0x10040bc10 )>

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.
2013-12-11 17:50:00.400 13+ Maths[1123:303] Unable to simultaneously satisfy constraints:
(
    "<NSAutoresizingMaskLayoutConstraint:0x600000289bf0 h=--& v=--& V:[NSToolbarItemViewer:0x10040c590(5)]>",
    "<NSAutoresizingMaskLayoutConstraint:0x6000002899c0 h=--& v=-&- V:|-(10)-[_NSToolbarSpace:0x60000015b3e0]   (Names: '|':NSToolbarItemViewer:0x10040c590 )>",
    "<NSAutoresizingMaskLayoutConstraint:0x600000289970 h=--& v=-&- V:[_NSToolbarSpace:0x60000015b3e0]-(11)-|   (Names: '|':NSToolbarItemViewer:0x10040c590 )>"
)

Will attempt to recover by breaking constraint 
<NSAutoresizingMaskLayoutConstraint:0x6000002899c0 h=--& v=-&- V:|-(10)-[_NSToolbarSpace:0x60000015b3e0]   (Names: '|':NSToolbarItemViewer:0x10040c590 )>

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.

使用它是否打破了基本约束removeItemAtIndex?或者有没有其他方法可以在不破坏约束的情况下删除项目。

谢谢。

4

0 回答 0