title: How to determine UIWebView height based on content, within a variable height UITableView?
body: <p>I am trying to create a <code>UITableView</code> with variable height rows as explained in the answer to <a href="https://stackoverflow.com/questions/272584/is-there-a-better-way-to-determine-the-right-size-for-a-uitableviewcell">this question</a></p>
  
  <p>My problem is each cell contains a <code>UIWebView</code> with different (statically loaded) content I can't figure out how to calculate the proper height based on the content. Is there a way to do this? I've tried things like this:</p>
  
  <pre><code>   (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
         WebViewCell *cell = (WebViewCell*)[self tableView:tableView cellForRowAtIndexPath:indexPath];
         [cell setNeedsLayout];
         [cell layoutIfNeeded];
         return cell.bounds.size.height;
      }
  </code></pre>
  
  <p>The cells themselves are loaded from a nib, which is simply a <code>UITableViewCell</code> containing a <code>UIWebView</code>. (It would also be fine if the cells just adjusted themselves to the largest of the html content, though variable height would be nicer).</p>