Every time one of my custom UITableViewCells is drawn tableView: cellForRowAtIndexPath: the console spits out a bunch of NSLayoutConstraint inconsistencies. I understand most of them:
Unable to simultaneously satisfy constraints. ...boring stuff.. "<NSLayoutConstraint:0x8b0eb60 V:|-(NSSpace(20))-[UILabel:0x8b0cb30] (Names: '|':UITableViewCellContentView:0x8bd7d40 )>", "<NSLayoutConstraint:0x8b0db70 V:[UILabel:0x8b0cb30]-(NSSpace(8))-[UITextView:0x91dba00]>", "<NSLayoutConstraint:0x8b0dba0 V:[UITextView:0x91dba00]-(NSSpace(20))-| (Names: '|':UITableViewCellContentView:0x8bd7d40 )>", "<NSLayoutConstraint:0x8b0d5a0 V:[UITextView:0x91dba00(1000)]>", "<NSAutoresizingMaskLayoutConstraint:0x8b00330 h=--& v=--& V:[UITableViewCellContentView:0x8bd7d40(44)]>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x8b0db70 V:[UILabel:0x8b0cb30]-(NSSpace(8))-[UITextView:0x91dba00]>
Or at least I think I know. What really puzzles me is that my UITableViewCell is working, and no restrictions seem to be broken. I think that some of the limitations listed in the error, especially the latter, are limitations added by the system. Is this possible if I do not use .xibs and just add restrictions to the code? The last line of the error applies to me, in particular, because I dynamically generate the height for each code, but I noticed that there is 44, the default cell height.
Some of these restrictions are added by default, for example, when I call [super updateConstraints] ? How can I solve these errors or find out where they come from?
On the side of the note, I understand that diving into Core Text works much better than my UITextView + Auto Layout solution. I'm currently working on caching cell heights. However, can these layout errors cause lag during scrolling or simply because I use Auto Layout to calculate the height of each cell when it appears on the screen?
I posted a project in which these errors occur on Github if someone wants to download and experience weirdness for themselves.
source share