title: How to get height of dynamically created UITextView iphone
body: <p>I am trying to create a table with cells that contain UITextViews inside them for variable amounts of text.  I need to specify the height of each cell to match the content size of the textviews.  I am using...</p>
  
  <pre><code>- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  
      UITextView *historyNode = [[[UITextView alloc]init]autorelease];
      historyNode.text = (@"%@",[globalArrayWithStrings objectAtIndex:[indexPath row]]);
      NSLog(@"%2.0f",historyNode.frame.size.height);
      return historyNode.contentSize.height;
  }
  </code></pre>
  
  <p>For some reason, it always prints 0.  If i print the height of a textview created in interface builder, it prints the correct value.  Any ideas how to get around this or why I can't get the size of a textview until it is added to the view.</p>