У меня есть этот код, но он выходит из строя.
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = (UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
if (cell.textLabel.numberOfLines == 2) {
return 100;
} else {
return 80;
}
}
Проблема здесь:
UITableViewCell *cell = (UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath];