title: iPhone UILabel sizeWithFont:
body: <p>I'm trying to measure the visual size of a NSString that takes into account the number of lines I can render. However, sizeWithFont doesn't take into account numberOfLines property? So my layout algorithm positions everything lower than they actually need to be.</p>
  
  <pre><code>_price = [[UILabel alloc] init];
  _price.text = myPriceValue;
  _price.lineBreakMode = UILineBreakModeWordWrap;
  _price.numberOfLines = 3;
  _price.backgroundColor = [UIColor clearColor];
  _price.textColor = TTSTYLEVAR(colorPrice);
  /// the follow code ignores numberOfLines and just tells me the size of the whole block.  
  // I'd like it to be aware of numberOfLines
  //
  CGSize priceSize = [_price.text sizeWithFont:_price.font
          constrainedToSize:CGSizeMake(maxWidth, CGFLOAT_MAX)
          lineBreakMode:UILineBreakModeWordWrap];
  </code></pre>
  
  <p>Does anyone know how to do this using the iPhone SDK?</p>