guys. I have UITableView with different cells and I have code, which counts height. In one project it works perfect, but in second it returns height equals 0. What could be causing this? My code:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath];
CGFloat cellWidth = 320.0f;
CGSize size = [cell.textLabel.text sizeWithFont:cell.textLabel.font constrainedToSize:CGSizeMake(cellWidth, CGFLOAT_MAX) lineBreakMode:cell.textLabel.lineBreakMode];
CGFloat height = size.height;
NSLog(@"Height: %f", height);
return height;
}