I am having an app in which I have a Tableview and on that tableview\'s each row I am dynamically creating a custom tableview cell.
Below is the cod
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *str = [arrComments objectAtIndex:indexPath.row];
UIFont *font = [UIFont fontWithName:@"Helvetica" size:14];
CGRect new = [str boundingRectWithSize:CGSizeMake(280, 999) options:NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName: font} context:nil];
CGSize size= new.size;
NSLog(@"%f",size.height);
if (size.height<20)
{
size.height=20;
//m= size.height;
}
NSLog(@"%f",size.height);
return size.height + 30;
}