title: iOS xcode, adding UILabel subview to custom table cell, label text does not update on screen
body: <p>I've created a custom UITableViewCell class, and used the layoutSubviews method to add a custom label.  Like this:</p>
  
  <pre><code>- (void)layoutSubviews
  {
      [super layoutSubviews];
  
      if (statusLabel == nil)
      {
          statusLabel = [[UILabel alloc]initWithFrame:CGRectMake(430.0, 10.0, 100.0, 20.0)];
          [statusLabel setTextAlignment:UITextAlignmentRight];
          [statusLabel setText:@"Status, set in code"];
          statusLabel.tag = 1;
  
          [self.contentView addSubview:statusLabel];
      }        
  }
  </code></pre>
  
  <p>As you can see, I have set the initial text of the label to "Status, set in code".</p>
  
  <p>In the table view controller I set the text for this custom label in the cellForRowAtIndexPath method, like so:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView
       cellForRowAtIndexPath:(NSIndexPath *)indexPath 
  {
      int index = [indexPath row];
  
      NSString *introducerString =[introducers objectAtIndex:index];
          NSArray *parts = [introducerString componentsSeparatedByString:@","];
  
      static NSString *MyIdentifier = @"Requester";
      UITableViewCell *cell = [tableView
                               dequeueReusableCellWithIdentifier:MyIdentifier];
      if (cell == nil) 
      {
          cell = [[[DanceCardCell alloc] initWithStyle:UITableViewCellStyleSubtitle
                                         reuseIdentifier:MyIdentifier] autorelease];
      }
  
      UIImage *image = [UIImage imageNamed:@"1.jpg"];
      [cell.imageView setImage:image];
      cell.textLabel.text = [parts objectAtIndex:1];
      cell.detailTextLabel.text = @"Some text";
  
      UILabel *statusLabel = (UILabel *)[cell viewWithTag:1];
      statusLabel.text = @"Did it!";
  
      return cell;
  }
  </code></pre>
  
  <p>I'm using one table view to display two lists, depending on which of two buttons is pressed. When a button is pressed the appropriate table view controller is attached to the table view, and the reloadData method is called to trigger display of the new data. The new data does display, but the custom label text, which should read "Did it!" reads "Status, set in code ...", until I switch lists again twice.</p>
  
  <p>How can I get the new text for the custom label to update straight away? I have checked the official documentation and cannot find any reference to refreshing a cell's display after updating its custom content.</p>
  
  <p>Here is a screen shot to demonstrate what happens: <a href="http://www.dsbsystems.co.uk/images/xcode1.png" rel="nofollow noreferrer">http://www.dsbsystems.co.uk/images/xcode1.png</a></p>