Step #3 Call this utility function to determine cell height from table view delegate method heightForRowAtIndexPath.
String parameter passed in this method should be same as you set above cell.textLabel.text.
+ (CGFloat) getTextHeight:(NSString*)str atFont:(UIFont*)font
CGSize size = CGSizeMake(300, 1000);// here is some trick.
CGSize textSize = [str sizeWithFont:font constrainedToSize:size];
Here we have task size in first list of function, it determines maximum acceptable size for the string.
Behind the function, logic is that function creates a buffer size, draws text in that buffer and returns the exact size of text draw. If the height specified in the size is less than a calculate string size, this method may return a height value that is bigger than the one specified.