0

我的项目从 Xcode 中跳出了这个错误代码。它适用于 OS X。我该如何解决这个问题?

2013-03-11 20:39:12.804 Project1[2038:303] Unable to simultaneously satisfy constraints:
   (
        "<NSAutoresizingMaskLayoutConstraint:0x101a1e8e0 h=--& v=--& H:    [NSView:0x100130d40(0)]>",
    "<NSLayoutConstraint:0x10013a5d0 H:[NSScrollView:0x1001310b0]-(17)-|   (Names: '|':NSView:0x100130d40 )>",
    "<NSLayoutConstraint:0x1001382c0 H:|-(17)-[NSScrollView:0x1001310b0]   (Names: '|':NSView:0x100130d40 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x10013a5d0 H:[NSScrollView:0x1001310b0]-(17)-|   (Names: '|':NSView:0x100130d40 )>

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-03-11 20:39:12.806 Project1[2038:303] Unable to simultaneously satisfy constraints:
(
    "<NSAutoresizingMaskLayoutConstraint:0x101a1e9a0 h=--& v=--& V:[NSView:0x100130d40(0)]>",
    "<NSLayoutConstraint:0x10013a630 V:|-(102)-[NSScrollView:0x1001310b0]   (Names: '|':NSView:0x100130d40 )>",
    "<NSLayoutConstraint:0x100138320 V:[NSScrollView:0x1001310b0]-(17)-|   (Names: '|':NSView:0x100130d40 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x100138320 V:[NSScrollView:0x1001310b0]-(17)-|   (Names: '|':NSView:0x100130d40 )>

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.
4

1 回答 1

1

You have set your own auto-layout constraint that is conflicting with your other constraint.

This happens as :

If you set the difference between two buttons as 10 and from window border as 20. But your button sees that it is not 20 from window border and it can not move towards the border since your other constraint is 10.

enter image description here

于 2013-03-11T12:50:08.350 回答