In my app I have a table view with customised table view cells. In iOS5 i use the following snippet of code to get the correct height for my customised cells. In iOS6 after doing a [tableView reloadData] the [cell layoutIfNeeded] will not trigger the cells layoutSubViews method. And because of that the cells heights are wrongly calculated. Any good suggestions to why this is? Or maybe alternative ways of doing it?
- (CGFloat)tableView:(UITableView *)aTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self tableView:aTableView cellForRowAtIndexPath:indexPath];
[cell setNeedsLayout];
[cell layoutIfNeeded];
[cell sizeToFit];
return cell.frame.size.height;
}