I'm trying to reduce set a specific tableview cell's height to zero depending on particular conditions. I have used the tableview delegate methods as so:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 1) {
return 0;
}
return 45.0f;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Only indicating the necessary code to hide the cell
if (indexPath.row == 1) {
cell.hidden = YES;
}
}
It works as it should , hiding the cell. However, I get a warning which I am weary about incase the app doesn't get approved. Below is the log:
Unable to simultaneously satisfy constraints.
(
"<NSLayoutConstraint:0x7fb903c3bab0 UILabel:0x7fb903c3afb0'Vehicle Type'.bottom == UITableViewCellContentView:0x7fb903c3ae90.bottomMargin - 4>",
"<NSLayoutConstraint:0x7fb903c3bb50 UILabel:0x7fb903c3afb0'Vehicle Type'.top == UITableViewCellContentView:0x7fb903c3ae90.topMargin + 4>",
"<NSLayoutConstraint:0x7fb903c8c760 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x7fb903c3ae90(0)]>"
)
NB: I am using a custom tableviewcell