我收到一个我不明白的自动布局错误:
2013-03-14 18:30:48.842 driver[7177:907] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x1ede73e0 UILabel:0x1ede4320.top == PriceCell:0x1edcd0c0.top + 160>",
"<NSLayoutConstraint:0x1ede7460 V:[UILabel:0x1ede4320]-(7)-[UIImageView:0x1ede45d0]>",
"<NSLayoutConstraint:0x1ede74a0 UIImageView:0x1ede45d0.centerY == UIImageView:0x1f856810.centerY>",
"<NSLayoutConstraint:0x1ede7880 UIImageView:0x1f856810.top == PriceCell:0x1edcd0c0.top + 30>",
"<NSLayoutConstraint:0x1ede78c0 UIImageView:0x1f856810.bottom == PriceCell:0x1edcd0c0.bottom>",
"<NSAutoresizingMaskLayoutConstraint:0x1f83f340 h=--& v=--& V:[PriceCell:0x1edcd0c0(300)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x1ede7460 V:[UILabel:0x1ede4320]-(7)-[UIImageView:0x1ede45d0]>
Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
问题:从错误列表中我无法确定自动布局所指的 ui 元素。所以我回到我的 Storyboard 并在我的 tableviewcell 中的每个 UI 元素中分配一个 Identifier 在字段 Restoration Id 中。我在某处读到错误消息中的十六进制数字然后替换为我分配给相应 ui 元素的名称。但不幸的是,这并没有发生。那么我在这里做错了什么,或者我错过了什么?