title: Dynamic height for a UITableViewCell with a dynamic UILabel
body: <p>I have a UITableViewController that displays a custom UITableViewCell (inherited from UITableViewCell). That same UITableViewCell has a UILabel that can have text of variable length. The challenge I am having is how to access this UILabel in my UITableViewController so that I can set the correct cell height in heightForRowAtIndexPath. </p>
  
  <p>Or on a side note how do I solve my problem of having a dynamicically sized label.</p>
  
  <p>thanks</p>
  
  <p>Here is my code for the custom UITableViewCell:</p>
  
  <p>header:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface MessagesCustomViewCell : UITableViewCell
  
  @property (nonatomic, weak) IBOutlet UILabel *message;   &lt;---- need to access this 
  
  @end
  </code></pre>
  
  <p>implementation:</p>
  
  <pre><code>#import "MessagesCustomViewCell.h"
  
  @implementation MessagesCustomViewCell
  @synthesize message=_message;
  
  - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  {
      self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
      if (self) {
          // Initialization code
      }
      return self;
  }
  
  - (void)setSelected:(BOOL)selected animated:(BOOL)animated
  {
      [super setSelected:selected animated:animated];
  
      // Configure the view for the selected state
  }
  
  @end
  </code></pre>