title: UILabel with dynamic width - Horizontal Alignment
body: <p>I have an UILabel in a custom cell class in an UITableView and I use the following code to increase the width of the label dynamically in regards of its content:</p>
  
  <pre><code>CGSize sizeToMakeLabel = [cell.cellResult.text sizeWithFont:cell.cellResult.font];
  
  cell.cellResult.frame = CGRectMake(cell.cellResult.frame.origin.x, cell.cellResult.frame.origin.y, sizeToMakeLabel.width, sizeToMakeLabel.height);
  </code></pre>
  
  <p>The problem that appears using the above code, is that I can no longer have the label to be right aligned (increase the width of it to the left instead of right). </p>
  
  <p>If I don't use the above code and set alignment to right in IB, the alignment works. But in this case, I lose the dynamic width.</p>
  
  <p>I've tried with:</p>
  
  <pre><code>cell.cellResult.textAlignment = UITextAlignmentRigth;
  cell.cellResult.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
  </code></pre>
  
  <p>but nothing happens.</p>
  
  <p>Can someone help me out on this one please ?</p>