I was stuck in this problem for 1 and half day.
Here is my code.
-(void)ShowtableHeight:(NSIndexPath*)indexpath
{
NSArray *visibleRows = [recTableView indexPathsForVisibleRows];
[recTableView reloadRowsAtIndexPaths:visibleRows withRowAnimation:UITableViewRowAnimationNone];
}
I called this function from
- (void)webViewDidFinishLoad:(UIWebView *)aWebView
My tableView Rows Were displaying data in webView.
So for dynamic height of data I wrote ShowtableHeight function. And the indexpath parameter for ShowtableHeight function come from webViewDidFinishLoad function like this,
NSIndexPath *index = [recTableView indexPathForCell:cell];
And if you want to pass section as parameter then you can write following in webViewDidFinishLoad accordingly
NSString *key = [dateArr objectAtIndex:index.section];
This will pass the number of sections in tableview.