title: When to capture a UILabel's height?
body: <p>I'm trying to capture a UILabel's height in an instance variable.  I'm using a default style <code>UITableViewCellStyleValue2</code>.</p>
  
  <p>As of now, I try to capture the height when the cell is created in</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  </code></pre>
  
  <p>The code (skipped the deque'd stuff for brevity):</p>
  
  <pre><code>UITableViewCell *testCell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:@"myCell"] autorelease];
  
  testCell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
  testCell.detailTextLabel.numberOfLines = 10;
  
  testCell.selectionStyle = UITableViewCellSelectionStyleNone;
  
  testCell.textLabel.text = @"LabelName";
  testCell.detailTextLabel.text = [object valueForKey:@"key"];
  [testCell.detailTextLabel sizeToFit];  //still says 0.00 :-(
  
  labelHeight = testCell.detailTextLabel.bounds.size.height;
  NSLog(@"testCell height is %f", testCell.detailTextLabel.bounds.size.height);  // equals 0.00
  NSLog(@"cellFrame is %f", testCell.frame); //also says 0.00
  return cell;
  </code></pre>
  
  <p>The <code>NSLog</code> states the height is 0.00.  </p>
  
  <p>So, where is a good place to capture a label's height?  Or, what am I missing?  I would think the <code>detailTextLabel</code> bounds would be set when I assign it <code>[someObject valueForKey:theKey]</code>.  Thanks!</p>
  
  <p>EDIT:  For complete code.</p>