Dynamically set UITableView height by its content

Hi,


I have a mainTableView it has a custom TableViewCell, in this cell im using a TableView, i want to set the height of innerTableView depending on the contentSize of it. contentSize is not returning correct contentSize.

I have also tried to get the height of every cell and then celculate whole height but it is not returning correct heights for cells

CGRect frame = [self.Table rectForRowAtIndexPath:indexPath];
Dynamically set UITableView height by its content
 
 
Q