当我进入某个视图时,我总是得到这个巨大的约束警告,这会使我的控制台变得混乱。我意识到我的约束可能已经关闭但是所有内容都显示了我想要它的方式而没有任何故事板或编译时警告。
那么有没有办法摆脱这个令人讨厌的大消息呢?
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-08-05 15:26:27.151[APP][12834:12179015] 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:0x7ffef7529660 H:[UIImageView:0x7ffef75294b0(94)]>",
"<NSLayoutConstraint:0x7ffef752a220 H:[UILabel:0x7ffef752a020'Mahi Mahi Filet Fresh'(432)]>",
"<NSLayoutConstraint:0x7ffef752d470 UIImageView:0x7ffef75294b0.leading == UITableViewCellContentView:0x7ffef7529370.leadingMargin>",
"<NSLayoutConstraint:0x7ffef752d790 H:[UIImageView:0x7ffef75294b0]-(NSSpace(8))-[UILabel:0x7ffef752a020'Mahi Mahi Filet Fresh']>",
"<NSLayoutConstraint:0x7ffef752dc90 UITableViewCellContentView:0x7ffef7529370.trailingMargin == UILabel:0x7ffef752c180'07/07'.trailing>",
"<NSLayoutConstraint:0x7ffef752dce0 H:[UILabel:0x7ffef752a020'Mahi Mahi Filet Fresh']-(NSSpace(8))-[UILabel:0x7ffef752c180'07/07']>",
"<NSLayoutConstraint:0x7ffef75351b0 'fittingSizeHTarget' H:[UITableViewCellContentView:0x7ffef7529370(375)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7ffef752a220 H:[UILabel:0x7ffef752a020'Mahi Mahi Filet Fresh'(432)]>