When I run the app, the layouts are ignored - ios

I tried adding constraints to a UICollectionView and a UILabel programmatically. Here is how I did it:
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"V:|-0-[_labelToChange(30)]-0-[_datesCollectionView]-0-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_labelToChange, _datesCollectionView)]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"H:|-0-[_labelToChange]-0-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_labelToChange)]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"H:|-0-[_datesCollectionView]-0-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_datesCollectionView)]];
When I run the app, the constraints are ignored, and I get the following error:
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:0x7f96c9daae70 H:|-(0)-[UICollectionView:0x7f96ca15a800] (Names: '|':DIDatepicker:0x7f96c9d7f950 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db6b00 h=--& v=--& UICollectionView:0x7f96ca15a800.midX == + 300>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db6b50 h=--& v=--& H:[UICollectionView:0x7f96ca15a800(540)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f96c9daae70 H:|-(0)-[UICollectionView:0x7f96ca15a800] (Names: '|':DIDatepicker:0x7f96c9d7f950 )>
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-06-04 13:58:14.692 myApp[581:8508] 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:0x7f96c9daaad0 H:|-(0)-[UILabel:0x7f96c9da8290] (Names: '|':DIDatepicker:0x7f96c9d7f950 )>",
"<NSLayoutConstraint:0x7f96c9daab20 H:[UILabel:0x7f96c9da8290]-(0)-| (Names: '|':DIDatepicker:0x7f96c9d7f950 )>",
"<NSLayoutConstraint:0x7f96c9daaef0 H:[UICollectionView:0x7f96ca15a800]-(0)-| (Names: '|':DIDatepicker:0x7f96c9d7f950 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db6b00 h=--& v=--& UICollectionView:0x7f96ca15a800.midX == + 300>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db6b50 h=--& v=--& H:[UICollectionView:0x7f96ca15a800(540)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db6e40 h=--& v=--& UILabel:0x7f96c9da8290.midX == + 300>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f96c9daab20 H:[UILabel:0x7f96c9da8290]-(0)-| (Names: '|':DIDatepicker:0x7f96c9d7f950 )>
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-06-04 13:58:14.696 myApp[581:8508] 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:0x7f96c9daaad0 H:|-(0)-[UILabel:0x7f96c9da8290] (Names: '|':DIDatepicker:0x7f96c9d7f950 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db6e40 h=--& v=--& UILabel:0x7f96c9da8290.midX == + 300>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db8960 h=--& v=--& H:[UILabel:0x7f96c9da8290(540)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f96c9daaad0 H:|-(0)-[UILabel:0x7f96c9da8290] (Names: '|':DIDatepicker:0x7f96c9d7f950 )>
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-06-04 13:58:14.699 myApp[581:8508] 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:0x7f96c9d80160 H:|-(0)-[DIDatepicker:0x7f96c9d7f950] (Names: '|':UITableViewCellContentView:0x7f96c9d7f330 )>",
"<NSLayoutConstraint:0x7f96c9d80200 H:[DIDatepicker:0x7f96c9d7f950]-(0)-| (Names: '|':UITableViewCellContentView:0x7f96c9d7f330 )>",
"<NSLayoutConstraint:0x7f96c9daaef0 H:[UICollectionView:0x7f96ca15a800]-(0)-| (Names: '|':DIDatepicker:0x7f96c9d7f950 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db6b00 h=--& v=--& UICollectionView:0x7f96ca15a800.midX == + 300>",
"<NSAutoresizingMaskLayoutConstraint:0x7f96c9db6b50 h=--& v=--& H:[UICollectionView:0x7f96ca15a800(540)]>",
"<NSLayoutConstraint:0x7f96c9db7dd0 'fittingSizeHTarget' H:[UITableViewCellContentView:0x7f96c9d7f330(375)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f96c9daaef0 H:[UICollectionView:0x7f96ca15a800]-(0)-| (Names: '|':DIDatepicker:0x7f96c9d7f950 )>

Related

Add constraints programmatically

I have 5 buttons I want to place on screen programmatically.
I want them to be 17px above the bottom of the view, and 20px space between every button.
I've done that like this:
let button1 = UIButton(frame: CGRectMake(20, 48, 50, 50))
button1.setImage(UIImage(named: "button1"), forState: .Normal)
let button2 = UIButton(frame: CGRectMake(91, 48, 50, 50))
button2.setImage(UIImage(named: "button2"), forState: .Normal)
let button3 = UIButton(frame: CGRectMake(162, 48, 50, 50))
button3.setImage(UIImage(named: "button3"), forState: .Normal)
let button4 = UIButton(frame: CGRectMake(233, 48, 50, 50))
button4.setImage(UIImage(named: "button4"), forState: .Normal)
let button5 = UIButton(frame: CGRectMake(304, 48, 50, 50))
button5.setImage(UIImage(named: "button5"), forState: .Normal)
self.addSubview(button1)
self.addSubview(button2)
self.addSubview(button3)
self.addSubview(button4)
self.addSubview(button5)
I works great and exactly what I want! But just on iPhone 6s screen size, so I guess the way to make it work on all screen sizes is using constraints, the problem is that I don't have an idea how can I add constraints programmatically.
Can someone help me here?
Thank you!
SaintThread answer, log error:
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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d968a10 h=--& v=--& UIButton:0x79729670.midX == + 45>",
"<NSLayoutConstraint:0x79725610 H:|-(48)-[UIButton:0x79729670] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>",
"<NSLayoutConstraint:0x797255e0 H:[UIButton:0x79729670(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x797255e0 H:[UIButton:0x79729670(50)]>
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.
2016-08-17 12:49:14.305 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d968a10 h=--& v=--& UIButton:0x79729670.midX == + 45>",
"<NSLayoutConstraint:0x79725610 H:|-(48)-[UIButton:0x79729670] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725610 H:|-(48)-[UIButton:0x79729670] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>
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.
2016-08-17 12:49:14.305 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d96a3c0 h=--& v=--& UIButton:0x79729670.midY == + 73>",
"<NSLayoutConstraint:0x79725c50 V:|-(20)-[UIButton:0x79729670] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>",
"<NSLayoutConstraint:0x79725ad0 V:[UIButton:0x79729670(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725ad0 V:[UIButton:0x79729670(50)]>
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.
2016-08-17 12:49:14.306 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d96a3c0 h=--& v=--& UIButton:0x79729670.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7d96a3f0 h=--& v=--& V:[UIButton:0x79729670(50)]>",
"<NSLayoutConstraint:0x79725c50 V:|-(20)-[UIButton:0x79729670] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725c50 V:|-(20)-[UIButton:0x79729670] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>
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.
2016-08-17 12:49:14.306 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7a991c60 h=--& v=--& UIButton:0x79729080.midX == + 116>",
"<NSLayoutConstraint:0x79725560 H:|-(48)-[UIButton:0x79729080] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>",
"<NSLayoutConstraint:0x79725510 H:[UIButton:0x79729080(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725510 H:[UIButton:0x79729080(50)]>
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.
2016-08-17 12:49:14.306 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7a991c60 h=--& v=--& UIButton:0x79729080.midX == + 116>",
"<NSAutoresizingMaskLayoutConstraint:0x7a991c90 h=--& v=--& H:[UIButton:0x79729080(50)]>",
"<NSLayoutConstraint:0x79725560 H:|-(48)-[UIButton:0x79729080] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725560 H:|-(48)-[UIButton:0x79729080] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>
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.
2016-08-17 12:49:14.307 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d96a3c0 h=--& v=--& UIButton:0x79729670.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7d96a3f0 h=--& v=--& V:[UIButton:0x79729670(50)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7a991cc0 h=--& v=--& UIButton:0x79729080.midY == + 73>",
"<NSLayoutConstraint:0x79725a10 V:[UIButton:0x79729670]-(20)-[UIButton:0x79729080]>",
"<NSLayoutConstraint:0x797259e0 V:[UIButton:0x79729080(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x797259e0 V:[UIButton:0x79729080(50)]>
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.
2016-08-17 12:49:14.307 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d96a3c0 h=--& v=--& UIButton:0x79729670.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7d96a3f0 h=--& v=--& V:[UIButton:0x79729670(50)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7a991cc0 h=--& v=--& UIButton:0x79729080.midY == + 73>",
"<NSLayoutConstraint:0x79725a10 V:[UIButton:0x79729670]-(20)-[UIButton:0x79729080]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725a10 V:[UIButton:0x79729670]-(20)-[UIButton:0x79729080]>
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.
2016-08-17 12:49:14.307 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d96b720 h=--& v=--& UIButton:0x79728480.midX == + 187>",
"<NSLayoutConstraint:0x79725490 H:|-(48)-[UIButton:0x79728480] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>",
"<NSLayoutConstraint:0x79725440 H:[UIButton:0x79728480(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725440 H:[UIButton:0x79728480(50)]>
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.
2016-08-17 12:49:14.308 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d96b720 h=--& v=--& UIButton:0x79728480.midX == + 187>",
"<NSAutoresizingMaskLayoutConstraint:0x7d96b750 h=--& v=--& H:[UIButton:0x79728480(50)]>",
"<NSLayoutConstraint:0x79725490 H:|-(48)-[UIButton:0x79728480] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725490 H:|-(48)-[UIButton:0x79728480] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>
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.
2016-08-17 12:49:14.308 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7a991cc0 h=--& v=--& UIButton:0x79729080.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7a991cf0 h=--& v=--& V:[UIButton:0x79729080(50)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7d96c260 h=--& v=--& UIButton:0x79728480.midY == + 73>",
"<NSLayoutConstraint:0x797259b0 V:[UIButton:0x79729080]-(20)-[UIButton:0x79728480]>",
"<NSLayoutConstraint:0x79725980 V:[UIButton:0x79728480(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725980 V:[UIButton:0x79728480(50)]>
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.
2016-08-17 12:49:14.308 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7a991cc0 h=--& v=--& UIButton:0x79729080.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7a991cf0 h=--& v=--& V:[UIButton:0x79729080(50)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7d96c260 h=--& v=--& UIButton:0x79728480.midY == + 73>",
"<NSLayoutConstraint:0x797259b0 V:[UIButton:0x79729080]-(20)-[UIButton:0x79728480]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x797259b0 V:[UIButton:0x79729080]-(20)-[UIButton:0x79728480]>
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.
2016-08-17 12:49:14.309 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7aad76b0 h=--& v=--& UIButton:0x79727bc0.midX == + 258>",
"<NSLayoutConstraint:0x797253b0 H:|-(48)-[UIButton:0x79727bc0] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>",
"<NSLayoutConstraint:0x79725380 H:[UIButton:0x79727bc0(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725380 H:[UIButton:0x79727bc0(50)]>
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.
2016-08-17 12:49:14.309 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7aad76b0 h=--& v=--& UIButton:0x79727bc0.midX == + 258>",
"<NSAutoresizingMaskLayoutConstraint:0x7aad76e0 h=--& v=--& H:[UIButton:0x79727bc0(50)]>",
"<NSLayoutConstraint:0x797253b0 H:|-(48)-[UIButton:0x79727bc0] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x797253b0 H:|-(48)-[UIButton:0x79727bc0] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>
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.
2016-08-17 12:49:14.309 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d96c260 h=--& v=--& UIButton:0x79728480.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7d96c290 h=--& v=--& V:[UIButton:0x79728480(50)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7aad7710 h=--& v=--& UIButton:0x79727bc0.midY == + 73>",
"<NSLayoutConstraint:0x79725950 V:[UIButton:0x79728480]-(20)-[UIButton:0x79727bc0]>",
"<NSLayoutConstraint:0x79725920 V:[UIButton:0x79727bc0(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725920 V:[UIButton:0x79727bc0(50)]>
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.
2016-08-17 12:49:14.309 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7d96c260 h=--& v=--& UIButton:0x79728480.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7d96c290 h=--& v=--& V:[UIButton:0x79728480(50)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7aad7710 h=--& v=--& UIButton:0x79727bc0.midY == + 73>",
"<NSLayoutConstraint:0x79725950 V:[UIButton:0x79728480]-(20)-[UIButton:0x79727bc0]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725950 V:[UIButton:0x79728480]-(20)-[UIButton:0x79727bc0]>
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.
2016-08-17 12:49:14.310 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7a993980 h=--& v=--& UIButton:0x797270c0.midX == + 329>",
"<NSLayoutConstraint:0x797252e0 H:|-(48)-[UIButton:0x797270c0] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>",
"<NSLayoutConstraint:0x79725290 H:[UIButton:0x797270c0(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79725290 H:[UIButton:0x797270c0(50)]>
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.
2016-08-17 12:49:14.310 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7a993980 h=--& v=--& UIButton:0x797270c0.midX == + 329>",
"<NSAutoresizingMaskLayoutConstraint:0x7a9939b0 h=--& v=--& H:[UIButton:0x797270c0(50)]>",
"<NSLayoutConstraint:0x797252e0 H:|-(48)-[UIButton:0x797270c0] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x797252e0 H:|-(48)-[UIButton:0x797270c0] (Names: '|':Arounder.CategoriesBarView:0x797c7190 )>
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.
2016-08-17 12:49:14.310 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7aad7710 h=--& v=--& UIButton:0x79727bc0.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7aad7a50 h=--& v=--& V:[UIButton:0x79727bc0(50)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7a993510 h=--& v=--& UIButton:0x797270c0.midY == + 73>",
"<NSLayoutConstraint:0x797258d0 V:[UIButton:0x79727bc0]-(20)-[UIButton:0x797270c0]>",
"<NSLayoutConstraint:0x797258a0 V:[UIButton:0x797270c0(50)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x797258a0 V:[UIButton:0x797270c0(50)]>
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.
2016-08-17 12:49:14.311 Arounder[3992:10988727] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x7aad7710 h=--& v=--& UIButton:0x79727bc0.midY == + 73>",
"<NSAutoresizingMaskLayoutConstraint:0x7aad7a50 h=--& v=--& V:[UIButton:0x79727bc0(50)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7a993510 h=--& v=--& UIButton:0x797270c0.midY == + 73>",
"<NSLayoutConstraint:0x797258d0 V:[UIButton:0x79727bc0]-(20)-[UIButton:0x797270c0]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x797258d0 V:[UIButton:0x79727bc0]-(20)-[UIButton:0x797270c0]>
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.
iOS 8 safe
Before adding the buttons to view
button1.translatesAutoresizingMaskIntoConstraints = false
button2.translatesAutoresizingMaskIntoConstraints = false
button3.translatesAutoresizingMaskIntoConstraints = false
button4.translatesAutoresizingMaskIntoConstraints = false
button5.translatesAutoresizingMaskIntoConstraints = false
After adding the buttons to view
let views = ["button1": button1,
"button2": button2,
"button3": button3,
"button4": button4,
"button5": button5]
let buttonConstraintsH = NSLayoutConstraint.constraintsWithVisualFormat(
"H:|-20-[button1]-20-[button2]-20-[button3]-20-[button4]-20-[button5]-20-|",
options: [],
metrics: nil,
views: views)
let button1ConstraintsV = NSLayoutConstraint.constraintsWithVisualFormat(
"V:[button1]-17-|",
options: [],
metrics: nil,
views: views)
let button2ConstraintsV = NSLayoutConstraint.constraintsWithVisualFormat(
"V:[button2]-17-|",
options: [],
metrics: nil,
views: views)
let button3ConstraintsV = NSLayoutConstraint.constraintsWithVisualFormat(
"V:[button3]-17-|",
options: [],
metrics: nil,
views: views)
let button4ConstraintsV = NSLayoutConstraint.constraintsWithVisualFormat(
"V:[button4]-17-|",
options: [],
metrics: nil,
views: views)
let button5ConstraintsV = NSLayoutConstraint.constraintsWithVisualFormat(
"V:[button5]-17-|",
options: [],
metrics: nil,
views: views)
NSLayoutConstraint.activateConstraints([buttonConstraintsH, button1ConstraintsV, button2ConstraintsV, button3ConstraintsV, button4ConstraintsV, button5ConstraintsV])
and to have the same ratio (write it for each button):
NSLayoutConstraint.activateConstraints(NSLayoutConstraint(
item:button1
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:button1
attribute:NSLayoutAttributeWidth
multiplier:1
constant:0))
I would recommend you to read more about NSLayoutAnchor (read more) which is easier way of creating constraints.
short snippet:
self.add
self.addSubview(button1)
self.addSubview(button2)
self.addSubview(button3)
self.addSubview(button4)
self.addSubview(button5)
button1.widthAnchor.constraintEqualToConstant(50).active = true
button1.heightAnchor.constraintEqualToConstant(50).active = true
button1.leadingAnchor.constraintEqualToAnchor(self.leadingAnchor, constant: 20).active = true
button1.topAnchor.constraintEqualToAnchor(self.topAnchor, constant: 50).active = true
....

Unable to simultaneously satisfy constraints using Cordova

I get the following error on my Cordova application in XCode.
2016-03-22 19:59:11.063 HelloCordova[280:83910] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x17dce400 h=--& v=--& V:[UIKeyboardAssistantBar:0x17e98840(0)]>",
"<NSLayoutConstraint:0x17eaf150 V:|-(0)-[_UIButtonBarStackView:0x17eaddf0] (Names: '|':UIKeyboardAssistantBar:0x17e98840 )>",
"<NSLayoutConstraint:0x17eaf190 V:[_UIButtonBarStackView:0x17eaddf0]-(0)-| (Names: '|':UIKeyboardAssistantBar:0x17e98840 )>",
"<NSLayoutConstraint:0x17dd5430 V:|-(0)-[_UIUCBKBSelectionBackground:0x17dd51c0] (Names: '|':_UIButtonBarButton:0x17dd46b0 )>",
"<NSLayoutConstraint:0x17dd54c0 _UIUCBKBSelectionBackground:0x17dd51c0.bottom == _UIButtonBarButton:0x17dd46b0.bottom>",
"<NSLayoutConstraint:0x17dd56a0 'UIButtonBar.maximumAlignmentSize' _UIButtonBarButton:0x17dd46b0.height == UILayoutGuide:0x17eae800'UIViewLayoutMarginsGuide'.height>",
"<NSLayoutConstraint:0x17eae8d0 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x17eae800'UIViewLayoutMarginsGuide']-(3)-| (Names: '|':_UIButtonBarStackView:0x17eaddf0 )>",
"<NSLayoutConstraint:0x17eae870 'UIView-topMargin-guide-constraint' V:|-(10)-[UILayoutGuide:0x17eae800'UIViewLayoutMarginsGuide'] (Names: '|':_UIButtonBarStackView:0x17eaddf0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x17dd54c0 _UIUCBKBSelectionBackground:0x17dd51c0.bottom == _UIButtonBarButton:0x17dd46b0.bottom>
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.
It's a brand new Cordova install today with the www folder replaced with an application I built a while back.
Where about would I need to look for more information on this?
Need any further information for debugging?
Thank you!

Conflicting constraints on GIDSignInButton in Google Sign-In SDK 2.0.1

I'm trying to upgrade from Google Sign-In SDK 1.0.0 to 2.0.1 and ran into some conflicting constraints when trying to position an instance of the GIDSignInButton.
It seems like GIDSignInButton may define its own dynamic constrains which conflict with the ones I set in Interface Builder. I'm not able to verify this since the SDK is closed source.
The constraint warning can actually be reproduced with Google's own sample code on https://github.com/googlesamples/google-services/tree/81c831d85a67157746009fa2df81a683f860d21e/ios/signin.
Is there a work around to position this button or is this just a bug in SDK 2.0.1?
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:0x7f9e0064b650 V:[UIView:0x7f9e0064b360(198)]>",
"<NSLayoutConstraint:0x7f9e0064b830 UIView:0x7f9e0064b360.centerY == GIDSignInButton.centerY (Names: GIDSignInButton:0x7f9e0046f000 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7f9e006603c0 h=--& v=--& GIDSignInButton.midY == + 97 (Names: GIDSignInButton:0x7f9e0046f000 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f9e0064b830 UIView:0x7f9e0064b360.centerY == GIDSignInButton.centerY (Names: GIDSignInButton:0x7f9e0046f000 )>
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.
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:0x7f9e00476cd0 GIDSignInButton.width == 3.26531*GIDSignInButton.height (Names: GIDSignInButton:0x7f9e0046f000 )>",
"<NSLayoutConstraint:0x7f9e00476f20 H:[GIDSignInButton(160)] (Names: GIDSignInButton:0x7f9e0046f000 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7f9e00660410 h=--& v=--& V:[GIDSignInButton(44)] (Names: GIDSignInButton:0x7f9e0046f000 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f9e00476cd0 GIDSignInButton.width == 3.26531*GIDSignInButton.height (Names: GIDSignInButton:0x7f9e0046f000 )>
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.
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:0x7f9e0064b7e0 UIView:0x7f9e0064b360.centerX == GIDSignInButton.centerX (Names: GIDSignInButton:0x7f9e0046f000 )>",
"<NSLayoutConstraint:0x7f9e00657480 H:[UIView:0x7f9e0064b360]-(0)-| (Names: '|':UIView:0x7f9e0064b050 )>",
"<NSLayoutConstraint:0x7f9e006574d0 H:|-(0)-[UIView:0x7f9e0064b360] (Names: '|':UIView:0x7f9e0064b050 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7f9e0065dda0 h=--& v=--& GIDSignInButton.midX == + 207 (Names: GIDSignInButton:0x7f9e0046f000 )>",
"<NSLayoutConstraint:0x7f9e0046d5e0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7f9e0064b050(375)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f9e0064b7e0 UIView:0x7f9e0064b360.centerX == GIDSignInButton.centerX (Names: GIDSignInButton:0x7f9e0046f000 )>
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.
I had the same issue and the solution I found was to embed the google sign-in button in another view and set the constraints on the container.
the only constraints i gave to the GIDSignInButton instance was center (x,y) in container cause otherwise it will still be shifted to the right.
I hope this helps
Google has fixed this bug in Google Sign-In SDK 2.1.0 (released on 6/17/2015).
Fixes Auto Layout issues with GIDSignInButton.

Getting error when apply auto layout

I have a UICollectionView and a UILabel that I added constraints programmatically.
[_labelToChange setTranslatesAutoresizingMaskIntoConstraints:NO];
[_datesCollectionView setTranslatesAutoresizingMaskIntoConstraints:NO];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"V:|-0-[_labelToChange(30)]-0-[_datesCollectionView]-0-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_labelToChange, _datesCollectionView)]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"H:|-0-[_labelToChange]-0-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_labelToChange)]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"H:|-0-[_datesCollectionView]-0-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_datesCollectionView)]];
When I do that, I get the following error:
2015-06-05 11:07:37.013 myApp[602:10299] 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:0x7f87c1580420 V:[DIDatepicker:0x7f87c157fda0(94)]>",
"<NSLayoutConstraint:0x7f87c1580560 V:|-(0)-[DIDatepicker:0x7f87c157fda0] (Names: '|':UITableViewCellContentView:0x7f87c157f760 )>",
"<NSLayoutConstraint:0x7f87c1580600 V:[DIDatepicker:0x7f87c157fda0]-(0)-| (Names: '|':UITableViewCellContentView:0x7f87c157f760 )>",
"<NSLayoutConstraint:0x7f87c157ed80 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x7f87c157f760(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f87c1580420 V:[DIDatepicker:0x7f87c157fda0(94)]>
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-06-05 11:07:37.018 myApp[602:10299] 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:0x7f87c1580560 V:|-(0)-[DIDatepicker:0x7f87c157fda0] (Names: '|':UITableViewCellContentView:0x7f87c157f760 )>",
"<NSLayoutConstraint:0x7f87c1580600 V:[DIDatepicker:0x7f87c157fda0]-(0)-| (Names: '|':UITableViewCellContentView:0x7f87c157f760 )>",
"<NSLayoutConstraint:0x7f87c15a95f0 V:|-(0)-[UILabel:0x7f87c15a8840] (Names: '|':DIDatepicker:0x7f87c157fda0 )>",
"<NSLayoutConstraint:0x7f87c15a9790 V:[UILabel:0x7f87c15a8840(30)]>",
"<NSLayoutConstraint:0x7f87c15a98e0 V:[UILabel:0x7f87c15a8840]-(0)-[UICollectionView:0x7f87c1959000]>",
"<NSLayoutConstraint:0x7f87c15a9930 V:[UICollectionView:0x7f87c1959000]-(0)-| (Names: '|':DIDatepicker:0x7f87c157fda0 )>",
"<NSLayoutConstraint:0x7f87c157ed80 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x7f87c157f760(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f87c15a98e0 V:[UILabel:0x7f87c15a8840]-(0)-[UICollectionView:0x7f87c1959000]>
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.
What can I do to fix it?
Update
Thanks #rdelmar!! I did what #rdelmar said, and I now 1 error goes away but the other is still there:
2015-06-05 12:52:14.102 myApp[2373:44139] 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:0x7fa2e1d80470 V:[DIDatepicker:0x7fa2e1d7fd10]-(0)-| (Names: '|':UITableViewCellContentView:0x7fa2e1d7f6d0 )>",
"<NSLayoutConstraint:0x7fa2e1d80510 V:|-(0)-[DIDatepicker:0x7fa2e1d7fd10] (Names: '|':UITableViewCellContentView:0x7fa2e1d7f6d0 )>",
"<NSLayoutConstraint:0x7fa2e1da9740 V:|-(0)-[UILabel:0x7fa2e1da8970] (Names: '|':DIDatepicker:0x7fa2e1d7fd10 )>",
"<NSLayoutConstraint:0x7fa2e1da9990 V:[UILabel:0x7fa2e1da8970]-(0)-[UICollectionView:0x7fa2e20f8e00]>",
"<NSLayoutConstraint:0x7fa2e1da9a10 V:[UICollectionView:0x7fa2e20f8e00(85)]>",
"<NSLayoutConstraint:0x7fa2e1da9a60 V:[UICollectionView:0x7fa2e20f8e00]-(0)-| (Names: '|':DIDatepicker:0x7fa2e1d7fd10 )>",
"<NSLayoutConstraint:0x7fa2e1da4a50 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x7fa2e1d7f6d0(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fa2e1da9990 V:[UILabel:0x7fa2e1da8970]-(0)-[UICollectionView:0x7fa2e20f8e00]>

Programmatically attempting NSLayoutContraint gives "Unable to simultaneously satisfy constraints."

I seem to be having some problems settings up my constraints programmatically for a UITableView I am using. My attempt is below, and have tried every combination of using the translatesAutoresizingMaskIntoConstraints possible.
self.view.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"V:|-100-[_tableView]-20-|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_tableView)]];
I am just trying to add a space to the beginning and bottom of my UITableView on a UIViewController. Could anyone help with this?
The long, long error is below.
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)
(
"<NSAutoresizingMaskLayoutConstraint:0x75c8500 h=-&- v=-&- UITableView:0x799e400.midY == UIView:0x71a4ec0.midY>",
"<NSLayoutConstraint:0x71a5800 V:[UITableView:0x799e400]-(20)-| (Names: '|':UIView:0x71a4ec0 )>",
"<NSLayoutConstraint:0x71a5a60 V:|-(100)-[UITableView:0x799e400] (Names: '|':UIView:0x71a4ec0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x71a5800 V:[UITableView:0x799e400]-(20)-| (Names: '|':UIView:0x71a4ec0 )>
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.
2013-04-04 20:06:57.648 New eCard[29731:c07] 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)
(
"<NSAutoresizingMaskLayoutConstraint:0x75c8540 h=-&- v=-&- UITableView:0x799e400.height == UIView:0x71a4ec0.height>",
"<NSAutoresizingMaskLayoutConstraint:0x75c8500 h=-&- v=-&- UITableView:0x799e400.midY == UIView:0x71a4ec0.midY>",
"<NSLayoutConstraint:0x71a5a60 V:|-(100)-[UITableView:0x799e400] (Names: '|':UIView:0x71a4ec0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x71a5a60 V:|-(100)-[UITableView:0x799e400] (Names: '|':UIView:0x71a4ec0 )>
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.
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)
(
"<NSAutoresizingMaskLayoutConstraint:0x75c8540 h=-&- v=-&- UITableView:0x799e400.height == UIView:0x71a4ec0.height>",
"<NSAutoresizingMaskLayoutConstraint:0x75c8500 h=-&- v=-&- UITableView:0x799e400.midY == UIView:0x71a4ec0.midY>",
"<NSLayoutConstraint:0x71a5800 V:[UITableView:0x799e400]-(20)-| (Names: '|':UIView:0x71a4ec0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x71a5800 V:[UITableView:0x799e400]-(20)-| (Names: '|':UIView:0x71a4ec0 )>
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.
I found this issue about UICollectionView. I guess that is a good point to start debugging.
UICollectionView Cell + UiLabel with AutoLayout
Some other links with solutions I tried without success :
https://blog.safaribooksonline.com/2012/10/27/tip-unsatisfiable-auto-layouts-in-ios-6/
UITableView with autolayout and offset constraints

Resources