I was having issues with my cell background image being distorted, and after having it answered I then went to implement the solution which basically consisted of shortening the height of the specific offending cells (that automatically had height added to them). I did this as follows:
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath {
CGFloat standardHeight = 44.0;
if ([tableView numberOfRowsInSection:indexPath.section] == 1) {
standardHeight -= 2;
}
return standardHeight;
}
However, every time I run that, I get caught in some sort of execution loop, where the app keeps bouncing back between the first line of that method and the start of the if statement until it crashes.
Video: http://f.cl.ly/items/2F1E3r2A2p0y1b2j3R14/debug.mov
However, if I use something like this (one of the answers in the previous thread) it seems to work:
- (CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath {
CGFloat rowHeight = 44.0f;
if (indexPath.row == 0) {
rowHeight -=1;
}
return rowHeight;
}
What am I doing wrong? I just can't figure it out.