gpt4 book ai didi

cocoa 项目错误

转载 作者:行者123 更新时间:2023-12-03 17:54:41 24 4
gpt4 key购买 nike

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

最佳答案

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

这会发生:

如果您将两个按钮之间的差值设置为 10,距离窗口边框的差值设置为 20。但是您的按钮发现它距窗口边框的距离不是 20,并且它无法向边框移动,因为您的其他约束是 10。

enter image description here

关于 cocoa 项目错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15338863/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com