4

我刚刚将我的 Xcode 升级到 6.0.1,我无法再编译了。Xcode 构建失败并出现以下错误:

    nwi_state: registration failed (1000000)
2014-09-18 12:46:28.977 Interface Builder Cocoa Touch Tool[19152:359412] The view hierarchy is not prepared for the constraint: <NSLayoutConstraint:0x7fb2cb5b5800 UIImageView:0x7fb2cb5893e0.centerY == UITableViewLabel:0x7fb2cb5a8950.centerY>
    When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView _viewHierarchyUnpreparedForConstraint:] to debug.
2014-09-18 12:46:28.978 Interface Builder Cocoa Touch Tool[19152:359412] *** Assertion failure in -[UITableViewCellContentView _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:], /SourceCache/UIKit_Sim/UIKit-3318/NSLayoutConstraint_UIKitAdditions.m:558
Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool failed with exit code 255
4

1 回答 1

0

基于日志中的此注释:

添加到视图时,约束的项必须是该视图(或视图本身)的后代。如果在组装视图层次结构之前需要解决约束,这将崩溃。中断 -[UIView _viewHierarchyUnpreparedForConstraint:] 进行调试。

添加符号断点:-[UIView _viewHierarchyUnpreparedForConstraint:]

此外,您可能只想清除所涉及视图的约束。

于 2015-07-10T09:22:13.757 回答