title: Changing position of a UILabel for a custom UITableVIewCell
body: <p>Ok so i have been trying to fix a problem that i got for a couple of days now without success. Today i found a solution but not a FULL solution to my problem.</p>
  
  <p>So this is the problem.</p>
  
  <p><strong>It starts like this, please note the alignment of the time labels(the ones to the left)</strong></p>
  
  <p><img src="https://i.stack.imgur.com/3vC7X.png" alt="Screenshot 1"></p>
  
  <p><strong>But after the table reloads for the second time OR when i switch tabs back and forth it THEN changes to what i want it to look like from the beginning. Like this.</strong></p>
  
  <p><img src="https://i.stack.imgur.com/M0dCJ.png" alt="Screenshot 2"></p>
  
  <p>This is the code that does this inside <code>cellForRowAtIndexPath:</code></p>
  
  <pre><code>    if ([gameInfoObject.GameTime  isEqual: @"FT"] || ([gameInfoObject.GameTime rangeOfString:@":"].location != NSNotFound)) {   // CHeck to see if its FT or string contains ":" then hide liveB
  
          cell.liveButton.hidden = YES;
          CGRect frame = cell.gameTimeLabel.frame;
          frame.origin.x= 27;                         // move the label 10pts to the left since no image will be present
          cell.gameTimeLabel.frame= frame;
  </code></pre>
  
  <p>I found a solution from this post <a href="https://stackoverflow.com/questions/8352530/changing-the-position-of-custom-uibutton-in-custom-uitableviewcell">Changing the position of custom UIButton in custom UITableViewCell</a> but the problem is that it changes FOR ALL THE CELLS. As you can see i only need it to change for a few cells. Please help me what can i do im out of ideas...</p>
  
  <p><strong>EDIT 1 the whole code for</strong> <code>cellForRowAtIndexPath</code></p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
      static NSString *identifier = @"Cell";
      GamesInfoTableViewCell *cell = (GamesInfoTableViewCell *)[tableView dequeueReusableCellWithIdentifier:identifier];
  
      // Configure the cell...
  
      GameInfo *gameInfoObject;
  
      gameInfoObject =[gamesInfoArray objectAtIndex:indexPath.row];
  
      cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  
      cell.backgroundColor = TABLECOLOR;
  
      cell.homeTeamLabel.textColor = TEXT;
      cell.awayTeamLabel.textColor = TEXT;
      cell.gameTimeLabel.textColor = TEXT;
  
  
      cell.homeTeamLabel.text = gameInfoObject.HomeTeam;
      cell.awayTeamLabel.text = gameInfoObject.AwayTeam;
      cell.homeTeamScoreLabel.text = gameInfoObject.HomeScore;
      cell.awayTeamScoreLabel.text = gameInfoObject.AwayScore;
      cell.liveButton.image = [UIImage imageNamed:@"1675447.png"]; //Load the green image
  
      if ([gameInfoObject.GameTime  isEqual: @"FT"] || ([gameInfoObject.GameTime rangeOfString:@":"].location != NSNotFound)) {   // CHeck to see if its FT or string contains ":" then hide liveB
  
          cell.liveButton.hidden = YES;
  
          CGRect frame = cell.gameTimeLabel.frame;
          frame.origin.x= 27;                         // move the label 10pts to the left since no image will be present
          cell.gameTimeLabel.frame= frame;
  
  
      }
  
      else
          cell.liveButton.hidden = NO;
  
      if (([gameInfoObject.GameTime rangeOfString:@":"].location != NSNotFound)) {
          cell.accessoryType = FALSE;
          cell.userInteractionEnabled = NO;
          cell.homeTeamScoreLabel.hidden = YES;
          cell.awayTeamScoreLabel.hidden = YES;
      }
  
      cell.gameTimeLabel.text = gameInfoObject.GameTime;
  
      return cell;
  }
  </code></pre>