可可项目错误

时间:2013-03-11 12:42:29

标签: cocoa

我的项目从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.

1 个答案:

答案 0 :(得分:1)

您已设置了与其他约束冲突的自己的自动布局约束。

这发生在:

如果您将两个按钮之间的差异设置为10,并将窗口边框设置为20.但是您的按钮看到它不是来自窗口边界的20,并且由于您的其他约束为10,它无法移向边框。

enter image description here