Dynamic UIScrollView content: Unable to simultaneously satisfy constraints - ios

I'm attempting to set up autolayout for a paging scroll view with a dynamic number of pages (one primary subview per page). My view hierarchy is set up as follows:
Main view
Scroll view
UIView (fits content)
TutorialSubview
...
After adding all the views to an array, I have the following code to dynamically generate constraints:
self.iphoneSVContentWConstr.constant = (self.subVWidth * self.contentSV.frame.size.width);
NSMutableDictionary *views = [NSMutableDictionary new];
NSLayoutFormatOptions formatForVert = (NSLayoutFormatAlignAllTop | NSLayoutFormatAlignAllBottom);
NSMutableString *format = [NSMutableString stringWithString:#"|"];
int idx = 0; for (UIView *v in self.viewArr) {
NSString *key = [NSString stringWithFormat:#"View%i", idx];
[views setObject:v forKey:key];
[format appendFormat:#"[%#(%.f)]", key, self.subVWidth];
idx++;
}
[format appendString:#"|"];
NSLog(#"%#", format);
//Update the content view
[self.iphoneSVContent addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:format options:formatForVert metrics:nil views:views]];
[self.contentSV layoutIfNeeded];
This ends up outputting:
|[View0(320)][View1(320)][View2(320)][View3(320)]|
Which seems correct. However, I'm getting the following errors thrown:
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:0x17409f1d0 H:[UIView:0x174197c40(102400)]>",
"<NSLayoutConstraint:0x1742811d0 H:|-(0)-[TutorialSubview:0x1743a1960] (Names: '|':UIView:0x174197c40 )>",
"<NSLayoutConstraint:0x170287490 H:[TutorialSubview:0x1743a1960(320)]>",
"<NSLayoutConstraint:0x1702873f0 H:[TutorialSubview:0x1743a1960]-(0)-[TutorialSubview:0x1743a3100]>",
"<NSLayoutConstraint:0x1702871c0 H:[TutorialSubview:0x1743a3100(320)]>",
"<NSLayoutConstraint:0x1702872b0 H:[TutorialSubview:0x1743a3100]-(0)-[TutorialSubview:0x1743a3480]>",
"<NSLayoutConstraint:0x170287210 H:[TutorialSubview:0x1743a3480(320)]>",
"<NSLayoutConstraint:0x170286fe0 H:[TutorialSubview:0x1743a3480]-(0)-[TutorialSubview:0x1703a31e0]>",
"<NSLayoutConstraint:0x170287080 H:[TutorialSubview:0x1703a31e0(320)]>",
"<NSLayoutConstraint:0x170286f40 H:[TutorialSubview:0x1703a31e0]-(0)-| (Names: '|':UIView:0x174197c40 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x170286fe0 H:[TutorialSubview:0x1743a3480]-(0)-[TutorialSubview:0x1703a31e0]>
I have the following constraints set up on self.iphoneSVContent (the view they're all being added to within the scroll view):
At this point, I'm just unsure as to what's causing the issue. Any insight is much appreciated!

The problem seems to be the first constraint you are changing the constant
self.iphoneSVContentWConstr.constant = (self.subVWidth * self.contentSV.frame.size.width);
The value for the view's width you set with this constraint (which is 102400, from the conflicting constraints output) is not the same as 4* 320 (which is the width of the views inside it).
If the width of the UIView inside the scrollview is defined completely by the number of subviews it has inside (which already have defined width), you should not need this constraint self.iphoneSVContentWConstr, because you have enough constraints for the width to be calculated unambiguously.
If you still want to keep this width constraint, make sure you set the constant to the correct value, with something like:
self.iphoneSVContentWConstr.constant = (self.subVWidth * self.viewArr.count);
I suppose the width/height of the scrollview you set in the storyboard. That should be enough for it to work and for the constraints to not crash anymore.
I really liked the way you constructed the visual format string! Cool :)
Let me know how it went. Good luck!

Related

Auto layout error Unable to simultaneously satisfy constraints with UIScrollView

I have a UIScrollView that is to show UIImageViews. The ImageViews are programmatically inserted at runtime based on how many images are saved by the user previously. I get the error 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)
"<NSLayoutConstraint:0x17029cd90 H:[UIView:0x15cd31e70]-(0)-| (Names: '|':UIScrollView:0x15cd326b0 )>",
"<NSLayoutConstraint:0x17029d060 UIScrollView:0x15cd326b0.trailingMargin == UIView:0x15cd31e70.trailing>"
I do the basic Autolayout thing where the scrollview is pinned to all four sides at 0 points. I then add a contentView as a subview (plain UIView) of the UIScrollView which is also pinned to all four sides at 0 points.
EDIT Storyboard constraints image
I give the contentView a width in code like so:
CGSize pagesScrollViewSize = self.scrollView.frame.size;
NSDictionary *views = #{ #"contentView" : self.contentView};
NSDictionary *metrics = #{ #"width" : #(pagesScrollViewSize.width * self.mutableArray.count) };
NSArray *constraints;
constraints = [NSLayoutConstraint constraintsWithVisualFormat:#"H:|-[contentView(width)]-|" options:0 metrics:metrics views:views];
[self.scrollView addConstraints:constraints];
[self loadVisiblePages];
The UIImageViews are added like so where UIImageViews are added based on the number of pages set when the segue to the ViewController occurs.
-(void)loadVisiblePages{
CGRect frame = self.scrollView.bounds;
frame.origin.x = frame.size.width * self.page;
frame.origin.y = 0.0f;
ImageForArchiving *newImageObject = (ImageForArchiving*)self.mutableArray[page];
UIImage *imageForNewPageView = newImageObject.image;
UIImageView *newPageView = [[UIImageView alloc] initWithFrame:frame];
[newPageView setTranslatesAutoresizingMaskIntoConstraints:YES];
newPageView.contentMode = UIViewContentModeScaleAspectFit;
newPageView.image = imageForNewPageView;
[self.scrollView addSubview:newPageView];
[self.pageViews replaceObjectAtIndex:page withObject:newPageView];
}
}
Additionally, when I scroll the UIScrollView the images displayed change size erratically on rotation. I think that this is just a consequence of the above warning and the fact that I haven't layed out the UIImageViews yet. What does the above warning mean in this context and how do I fix it?
It seems you have pinned trailingMargin of scrollView to contentView.trailing.
Change scrollView.Trailing Margin to scrollView.Trailing for this constraint
You can do this in the activity inspector in the storyboard after selecting your constraint.
Alternatively, clear all constraints on your contentView. Then while adding pinning constraints again uncheck Constrain to margins and set all constants 0.
AND
Change this line in your code
NSArray *constraints;
constraints = [NSLayoutConstraint constraintsWithVisualFormat:#"H:|-[contentView(width)]-|" options:0 metrics:metrics views:views];
[self.scrollView addConstraints:constraints];
with this:
NSArray *constraints;
constraints = [NSLayoutConstraint constraintsWithVisualFormat:#"H:|[contentView(width)]|" options:0 metrics:metrics views:views];
[self.scrollView addConstraints:constraints];
Using #"H:|-[contentView(width)]-|" in visual format means pinning your contentView to the superView's margins and adds a space of 8 pts between the superView and subView. In your storyboard constraints you had set up constraints with the Trailing and Leading edges of the UIScrollView, while in the programmatically added constraint you had used Trailing Margin and Leading Margin (kind of asking the contentView to maintain an 8 pt. padding). Hence, the conflict.
Check Visual Format syntax here.

Custom UITableViewCell vertical layout constraints causing error

when I run my app on an iPhone I get the following errors. When I run it in the simulator I do not. If I take the -12-| away then the cell's height collapses to something like 30 pixels. And the UI breaks.
Can someone help me and tell me why?
Thanks
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:0x170285ff0 V:|-(12)-[UIImageView:0x1741ec200] (Names: '|':UITableViewCellContentView:0x17419c7d0 )>",
"<NSLayoutConstraint:0x170286040 V:[UIImageView:0x1741ec200(200)]>",
"<NSLayoutConstraint:0x170286090 V:[UIImageView:0x1741ec200]-(12)-| (Names: '|':UITableViewCellContentView:0x17419c7d0 )>",
"<NSLayoutConstraint:0x174881f40 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x17419c7d0(224)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x170286090 V:[UIImageView:0x1741ec200]-(12)-| (Names: '|':UITableViewCellContentView:0x17419c7d0 )>
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.
Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead.
Unable to simultaneously satisfy constraints.
In a custom UITableViewCell I defined the Layout Constraints as follows:
_imgView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"H:|-15-[imageView]-15-|" options:0 metrics:nil views:#{ #"imageView": _imgView }]];
[self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:#"V:|-12-[imageView(200)]-12-|" options:0 metrics:metrics views:#{ #"imageView" : _imgView }]];
--- EDIT ---
In response to the contentView.bounds suggestion:
In my UITableViewController I implement the following:
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 30.0f;
So a zero height, should not be an issue.
The initial height of the cell is likely smaller than the vertical constraints. This creates an initial height conflict until the contentView's frame changes.
You can work around this issue using one of the following approaches:
Increase the cell's height in the storyboard to initially fit the content.
Change the bounds of the cell's contentView to a larger size:
self.contentView.bounds = CGRectMake(0, 0, 99999, 99999);
You'll find more details in the answers to this auto layout question.
Update:
The "Unable to simultaneously satisfy constraints" conflict is between the imageView constraints trying to set the cell's height to 225 points, and the fixed height trying to set the cell height to 224 points.
Your imageView vertical constraints use 224 (12 + 200 + 12) points. The tableView separator uses 1 point. So the cell height needs to be 225 points for all constraints to be met.

Unable to simultaneously satisfy constraints in case of UICollectionViewCell

I am using iCarousel to implement a cover flow. I provide views to it in my iCarousel data source method, like this:
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view
{
if(!view) {
view = [[SDHotOnThumbView alloc]initWithFrame:CGRectMake(0, 0, kHotOnThumbViewWidth, kHotOnThumbViewHeight)];
view.contentMode = UIViewContentModeScaleAspectFit;
}
[((SDHotOnThumbView*)view) setData:[self.dataArray objectAtIndex:index]];
return view;
}
The method setData apart from setting the label's text in SDHotOnThumbView instance, and starting image download for the image view in it, also makes a call to a method updateLabelLayoutWithAttributedText, which is implemented as under in the SDHotOnThumbView class:
-(void)updateLabelLayoutWithAttributedText:(NSMutableAttributedString*) labelString
{
float height = [self heightOfAttributedText:labelString width:self.frame.size.width];
self.descriptionLabel.translatesAutoresizingMaskIntoConstraints = NO;
//self.descriptionLabel.preferredMaxLayoutWidth = self.frame.size.width;
NSDictionary *viewsDict = #{#"desclabel":self.descriptionLabel};
NSArray *constraintsH = [NSLayoutConstraint constraintsWithVisualFormat:#"H:|-0- [desclabel]-0-|" options:0 metrics:nil views:viewsDict];
[self addConstraints:constraintsH];
NSArray *constraintsV = [NSLayoutConstraint constraintsWithVisualFormat:[NSString stringWithFormat:#"V:[desclabel(==%f)]-10-|", height]
options:0
metrics:nil
views:viewsDict];
[self addConstraints:constraintsV];
}
iCarousel recycles views, and I have to allocate a view if the recycled view is nil, and configure it every time the carousel asks for a view at a given index. Based on the size of an attributed string, I update vertical constraints for the label with the new height, in the second method I have attached, so that the label is resized as per the data it contains. The views layout just fine, except that I get . For example, I get
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:0x7b82f330 V:[UILabel:0x7d861820'SanDisk Cruzer Blade USB ...'(51.2)]>",
"<NSLayoutConstraint:0x7d862df0 V:[UILabel:0x7d861820'SanDisk Cruzer Blade USB ...'(65.6)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7d862df0 V:[UILabel:0x7d861820'SanDisk Cruzer Blade USB ...'(65.6)]>
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.
Logging computed heights for the label, I can see that probably when the cell is removed from the collection view and re-added for some different index in the collection view, it probably holds on to its old height, and tries to add a new vertical constraint, breaking the previous one. I even tried removing all label constraints from the view, and adding everytime set data is called, but i see the same happening in Xcode, even though everything seems to work as expected. How do I go about these Xcode warnings, or is it fine if the layout is as desired.
Somehow you doubly inserted 2 different heights to the label, the first one's height is 51.2 and the second one is 65.6. Please check your code once more.

Dynamically sized UIWebView in a UITableViewCell with auto layout - constraint violation

I've got a UITableViewCell which contains a UIWebView. The table view cell adjusts it's height depending on the web view contents.
I've got it all working fine, however when the view loads, I get a constraint violation exception in the debugger (the app continues running and functionally works fine, but I'd like to resolve this exception if possible).
How I've got it set up:
The TableView sets the cell height like this:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.section == 0) {
[_topCell layoutIfNeeded];
CGFloat finalHeight = [_topCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
return finalHeight + 1;
}
The cell constraints are as follows:
Arbitrary 7px offset from the cell's contentView (top) to the webView
Web view has arbitrary fixed height constraint of 62px (will expand later once content loads)
Arbitrary 8px offset from the webView to the cell's contentView (bottom)
in my viewDidLoad, I tell the webView to go and load a URL, and in the webViewDidFinishLoad, I update the web view height constraint, like this
-(void)webViewDidFinishLoad:(UIWebView *)webView {
CGSize fittingSize = [webView sizeThatFits:CGSizeZero];
// fittingSize is approx 500
[self.tableView beginUpdates];
// Exceptions happen on the following line setting the constant
_topCell.webViewHeightConstraint.constant = fittingSize.height;
[_topCell layoutSubviews];
[self.tableView endUpdates];
}
The exception looks like this:
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:0x10964b250 V:[webView(62)] (Names: webView:0x109664a00 )>",
"<NSLayoutConstraint:0x109243d30 V:|-(7)-[webView] (Names: webView:0x109664a00, cellContent:0x1092436f0, '|':cellContent:0x1092436f0 )>",
"<NSLayoutConstraint:0x109243f80 V:[webView]-(8)-| (Names: cellContent:0x1092436f0, webView:0x109664a00, '|':cellContent:0x1092436f0 )>",
"<NSAutoresizingMaskLayoutConstraint:0x10967c210 h=--& v=--& V:[cellContent(78)] (Names: cellContent:0x1092436f0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x10964b250 V:[webView(62)] (Names: webView:0x109664a00 )>
This seems a bit weird. It's implied that the constraint which sets the height of the web view is going to be broken, however the web view does get it's height correctly set, and the tableview renders perfectly well.
From my guesses, it looks like the newly increased web view height constraint (it's about 500px after the web view loads) is going to conflict with the <NSAutoresizingMaskLayoutConstraint:0x10967c210 h=--& v=--& V:[cellContent(78)] setting the cell height to 78 (put there by interface builder). This makes sense, however I don't want that cell content to have a fixed height of 78px, I want it to increase it's height, and functionally, it actually does this, just with these exceptions.
I've tried setting _topCell.contentView.translatesAutoresizingMaskIntoConstraints = NO; to attempt to remove the NSAutoresizingMaskLayoutConstraint - this stops the exceptions, but then all the other layout is screwed up and the web view is about 10px high in the middle of the table view for no reason.
I've also tried setting _topCell.contentView.autoresizingMask |= UIViewAutoresizingFlexibleHeight; in the viewDidLoad to hopefully affect the contentView 78px height constraint, but this has no effect
Any help would be much appreciated
An alternative answer, which ends up being far simpler:
Set the priority of the webViewHeight constraint to something other than required. Works well and there are no warnings. I'd recommend going with this :-)
I worked out a solution. It seems like a hack, but it works correctly and produces no errors and warnings.
The trick was to dissociate the web view's layout and height from the contentView.
I did this as follows:
In the tableviewcell, add a new UIView, called containerView
Give it constraints for Top:0 Left:0 Right:0 but no bottom constraint and no height constraint
Put the web view (and any other content) inside this containerView
Add constraints such that the web view is 7px from the top and bottom of containerView, and has a height constraint of 62px
At this point, the containerView isn't connected to the bottom of the table view cell, and so it could over/under flow without auto-layout complaining.
Now, in tableView:heightForRowAtIndexPath:, we calculate the cell height based on the containerView as follows:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.section == 0) {
CGFloat finalHeight = [_topCell.containerView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
return finalHeight + 1;
}
return [super tableView:tableView heightForRowAtIndexPath:indexPath];
}
All done!
From the Constraint log
The Constraint you are trying to achieve is as below,
In a 78 px cellContentHeight you want to fit a content of 7(top space) + 62 (Web View) + 8 (bottom space). which is 77 (not equal to 78). Either of two option would work,
Try giving top margin as 8 (instead of 7) and make it 78. (V:|-8-[WebView(62)]-8-|)
Attach to the top, give 8 pixel top space (V:|-8-[WebView(62)]) and don't specify 8 px bottom space.
Attach to Bottom, give 8 pixel bottom space (V:[WebView(62)-8-|) and don't specify top space.

Debug constraints when setting view programmatically

I have a complex set of labels and buttons. I set everything programmatically using mainly visual format language. The UILabels are created with the following method:
-(UILabel*)createLabelWithPlaceHolder:(NSString*)placeHolder{
UILabel *provisionalLabel=[[UILabel alloc] init];
provisionalLabel =[[UILabel alloc] init];
provisionalLabel.translatesAutoresizingMaskIntoConstraints=NO;
provisionalLabel.text=placeHolder;
provisionalLabel.font=[UIFont systemFontOfSize:12.0f];
provisionalLabel.backgroundColor=[UIColor greenColor];
provisionalLabel.textAlignment=NSTextAlignmentCenter;
[provisionalLabel setContentHuggingPriority:200 forAxis:UILayoutConstraintAxisHorizontal];
[provisionalLabel setContentCompressionResistancePriority:900 forAxis:UILayoutConstraintAxisHorizontal];
return provisionalLabel;
}
and the labels are displayed according to the following VLF code:
gap=(self.vistaGris.bounds.size.width*secondRowFactor)/7;
labelWidth=(self.vistaGris.bounds.size.width*(1-secondRowFactor))/6;
gapN=[NSNumber numberWithFloat:gap];
labelWidthN=[NSNumber numberWithFloat:labelWidth];
constraints = [NSLayoutConstraint
constraintsWithVisualFormat:#"H:|-gap-[solution4(width)]-gap-[solution5(width)]-gap-[solution6(width)]-gap-[solution7(width)]-gap-[solution8(width)]-gap-[solution9(width)]-gap-|"
options:NSLayoutFormatAlignAllBaseline
metrics:#{#"gap":gapN, #"width":labelWidthN}
views:viewsDictionary];
[self.vistaGris addConstraints:constraints];
Basically what it does is to display 6 labels on the bottom of the view. With equal spaces between them and same width. The device orientation is always landscape all the time.
The code does what I want it to do and everything is displayed OK. However I got a console warning telling me that the system cannot satisfy simultaneous constraints:
2014-04-19 09:59:48.749 Concentrations[431:60b] 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:0x8d6cd70 Linees:0x8c82d70.width == UIView:0x8c41c40.width>",
"<NSLayoutConstraint:0x8d84480 H:|-(6.85714)-[UILabel:0x8d65460] (Names: '|':Linees:0x8c82d70 )>",
"<NSLayoutConstraint:0x8d844d0 H:[UILabel:0x8d65460(72)]>",
"<NSLayoutConstraint:0x8d84500 H:[UILabel:0x8d65460]-(6.85714)-[UILabel:0x8d73890]>",
"<NSLayoutConstraint:0x8d84550 H:[UILabel:0x8d73890(72)]>",
"<NSLayoutConstraint:0x8d845b0 H:[UILabel:0x8d73890]-(6.85714)-[UILabel:0x8d731b0]>",
"<NSLayoutConstraint:0x8d845e0 H:[UILabel:0x8d731b0(72)]>",
"<NSLayoutConstraint:0x8d84640 H:[UILabel:0x8d731b0]-(6.85714)-[UILabel:0x8d734e0]>",
"<NSLayoutConstraint:0x8d84690 H:[UILabel:0x8d734e0(72)]>",
"<NSLayoutConstraint:0x8d84700 H:[UILabel:0x8d734e0]-(6.85714)-[UILabel:0x8d741b0]>",
"<NSLayoutConstraint:0x8d84730 H:[UILabel:0x8d741b0(72)]>",
"<NSLayoutConstraint:0x8d847d0 H:[UILabel:0x8d741b0]-(6.85714)-[UILabel:0x8d744d0]>",
"<NSLayoutConstraint:0x8d84800 H:[UILabel:0x8d744d0(72)]>",
"<NSLayoutConstraint:0x8d84860 H:[UILabel:0x8d744d0]-(6.85714)-| (Names: '|':Linees:0x8c82d70 )>",
"<NSAutoresizingMaskLayoutConstraint:0x8c8aef0 h=--& v=--& V:[UIView:0x8c41c40(480)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x8d847d0 H:[UILabel:0x8d741b0]-(6.85714)-[UILabel:0x8d744d0]>
The thing is that I don't set constraints for these labels anywhere else on my code and this debugger warning could not be less explanatory.
The warning says that you have an NSAutoresizingMaskLayoutConstraint (it derives from the autoresize automatically translated to constraints). Probably you want to set translatesAutoresizingMaskIntoConstraints=NO not only on the labels but on the vistaGris too.

Resources