title: Bottom/Right Alignment for a UITableView
body: <p>Aplogies, but this is another newbie iPhone/Objective-C question.</p>
  
  <p>I'm working on my first iPhone app which is a simple RPN calculator.  I have a table displaying the contents of the stack, and now I'd like to fine tune the display a little bit.</p>
  
  <p>I would like for the last entry in the stack to display at the bottom of the table, with the text right aligned.  The right alignment was easy with </p>
  
  <pre><code>cell.textLabel.textAlignment = UITextAlignmentRight;
  </code></pre>
  
  <p>and I can make the table peg the last entry to the bottom of the view with this code:</p>
  
  <pre><code>NSIndexPath *scrollIndexPath = [NSIndexPath indexPathForRow:(stackSize - 1) inSection:0];
  [tableView scrollToRowAtIndexPath:scrollIndexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
  </code></pre>
  
  <p>which works great but only when there are more entries on the stack than will fit in the view.  When the stack has few entries, they're still aligned to the top of the view.</p>
  
  <p>I've played a bit with altering the height of the cell for the first stack entry such that the first cell fills the whole view and shrinks as new cells are added until there are enough stack entries to fill the view, at which point the cell height is left alone.  This seemed promising, but I'm having some trouble getting the "big" cell to bottom align the label.  (It's vertical center aligned, by default.)</p>
  
  <p>As I was hacking away at the bottom alignment thing, I began to wonder if I'm making this more complicated than it needs to be.  Any thoughts?</p>