title: How to control my tableview cell label?
body: <p>i am new in iPhone development. I am developing an app which contains tableview with label inside the cell. I have placed different label for each row like this <code>if(indexpath.row == 0)</code> like this for each cell row i have done it. But when i am scrolling the tableview my label are getting mixed. Please help me!</p>
  
  <pre><code>static NSString *CellIdentifier = @"Cell";
  
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil)
  {
      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  }
  
  if (indexPath.row == 2)
  {
      pendingListNumberLabel = [[UILabel alloc] init];
      pendingListNumberLabel.font = [UIFont fontWithName:@"Helvetica" size:14];
      pendingListNumberLabel.textAlignment = UITextAlignmentLeft ;
      pendingListNumberLabel.textColor = [UIColor orangeColor];
      pendingListNumberLabel.frame = CGRectMake(240, 6, 110, 30);
      [pendingListNumberLabel setBackgroundColor:[UIColor clearColor]];
      [cell addSubview:pendingListNumberLabel];
  }
  
  cell.textLabel.text = [affiliationsArray objectAtIndex:indexPath.row];
  [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
  return cell;
  </code></pre>