December 13, 2013

I recently ran into a problem with a few of my tests after implementing the - (CGFloat)tableView:estimatedHeightForRowAtIndexPath: method on a few of my UITableViewControllers. It was fairly peculiar because it would only appear manifest itself when running tests

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) 
( "<_UIScrollViewAutomaticContentSizeConstraint:0x1e153990 UITableView:0xe068600.contentHeight{id: 78} == -26.500000>" )

Will attempt to recover by breaking constraint 
<_UIScrollViewAutomaticContentSizeConstraint:0x1e153990 UITableView:0xe068600.contentHeight{id: 78} == -26.500000>

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.