I need to load HTML in a cell of a table view. I'm using a UIWebView instead of a UILabel so that the html tags are interpreted. The size of the WebView differs, so I'm doing
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[webView sizeToFit];
}
So that the webview's size is properly set. However, I also need to define the height of the cell, which I was planning to set inside
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
}
Unfortunately the heightForRowAtIndexPath is called before webViewDidFinishLoad, so I'm not able to define the cell's height properly.
Any suggestions for my problem? I found an old question about this, but it didn't help me: How to determine UIWebView height based on content, within a variable height UITableView?
Thanks,
Adriana