title: dequeued UITableViewCell has incorrect layout until scroll (using autolayout)
body: <p>I have a custom <code>UITableViewCell</code> subclass which has had autolayout constraints applied to it in Interface Builder.  The cell contains multiple views, including a <code>UITextField</code>.</p>
  
  <p>Relevantly, the size of the <code>UITextField</code> is constrained such that there is default horizontal spacing between it and the next view.</p>
  
  <p>The cell is instantiated like follows:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"ProgressCell";
      ProgressCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier
                                                       forIndexPath:indexPath]
  
      cell.textField.text = @"Some string that is different for each cell";
  
      return cell;
  }
  </code></pre>
  
  <p>When the cell first appears, the <code>UITextField</code> overruns the correct frame, and appears behind the <code>UIView</code> to its right.  However, when I scroll the cell off screen, pause, and then scroll back, the text is truncated correctly.</p>
  
  <p>An example is shown below (at the second edit).</p>
  
  <p>I have tried calling <code>[cell setNeedsLayout]</code> and <code>[cell setNeedsDisplay]</code> for the cell in <code>cellForRowAtIndexPath</code>, as well as performing them after a delay.  Neither is effective.</p>
  
  <p>What is scrolling off screen doing that is causing the cell to appear correctly, and how can I either replicate this or fix the underlying issue?</p>
  
  <p>EDIT:</p>
  
  <p>Calling</p>
  
  <pre><code>[self.tableView reloadData];
  [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
  </code></pre>
  
  <p>in order to reload the cell, appears to cause the layout to appear correctly first time.</p>
  
  <p>However, it now <em>breaks</em> (occasionally) on scrolling (ie, when scrolling back up, the layout constraints are now not applied correctly).</p>
  
  <p>Calling <code>[cell setNeedsLayout]</code> in <code>cellForRowAtIndexPath</code> appears not to fix this issue.</p>
  
  <p>EDIT2:</p>
  
  <p>The top cell, as shown <a href="http://imgur.com/a/IKv0Z">here</a>, appeared correctly (as the bottom cell does) until I scrolled down the screen.  It since disappeared.</p>
  
  <p>This reflects the problem as of the first edit - it's the second rendering that is the problem (makes me think that it might have something to do with reusing the cell?)</p>