title: Why the UITableViewCell's changing their value in single cell?
body: <p>In my app, i have customize UITableViewCell and is using its contentView property. 
  But now the problem is the data in cells are sometimes going in different cells. For example:The data in cell 3 is going into cell 8 or 9 when scroll to the bottom or scroll up.
  Here's the code which iam using in cellForRowAtIndexPath:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
      static NSString *CellIdentifier = @"Cell";
      CGFloat fontSize = [UIFont systemFontSize];
      CGFloat smallFontSize = [UIFont smallSystemFontSize];
      UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier]autorelease];
          mainLabel = [[[UILabel alloc] initWithFrame:CGRectMake(5,0,150,42)] autorelease];
          mainLabel.font = [UIFont systemFontOfSize:smallFontSize];
          mainLabel.numberOfLines = 3;
          mainLabel.lineBreakMode = UILineBreakModeWordWrap;
          mainLabel.backgroundColor = [UIColor clearColor];
          mainLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
          [cell.contentView addSubview:mainLabel];
  
          secondLabel = [[[UILabel alloc] initWithFrame:CGRectMake(160,0,160,42)] autorelease];
          secondLabel.font = [UIFont systemFontOfSize:smallFontSize];
          secondLabel.numberOfLines = 3;
          secondLabel.lineBreakMode = UILineBreakModeWordWrap;
          secondLabel.backgroundColor = [UIColor clearColor];
          secondLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
          [cell.contentView addSubview:secondLabel];
  
  
      }
      cell.accessoryType = UITableViewCellAccessoryNone;
      cell.selectionStyle = UITableViewCellSelectionStyleNone;
      cell.textLabel.font = [UIFont systemFontOfSize:smallFontSize];
      cell.detailTextLabel.font = [UIFont systemFontOfSize:smallFontSize];
      NSArray * titles = [[NSArray alloc] initWithObjects:@"Project ID", @"Status", @"Approval Date", @"Closing Date", @"Country",@"Region Name", @"Env", @"Team Full Name",@"Borrower", @"Impagency", @"Lending Cost", @"IBRDPlus", nil];
  
      switch (indexPath.section) {
          case 0:
  
              mainLabel.text = [titles objectAtIndex:indexPath.row];
              mainLabel.adjustsFontSizeToFitWidth = YES;
              mainLabel.numberOfLines = 4;
              mainLabel.lineBreakMode = UILineBreakModeWordWrap;
  
              secondLabel.text = [self.basic objectAtIndex:indexPath.row];
              secondLabel.adjustsFontSizeToFitWidth = YES;
              secondLabel.numberOfLines = 4;
              secondLabel.lineBreakMode = UILineBreakModeWordWrap;
              break;
          case 1:
  
              mainLabel.text = [[self.allSectors objectAtIndex:indexPath.row] valueForKey:@"SECTORNAME"];
              mainLabel.adjustsFontSizeToFitWidth = YES;
              mainLabel.numberOfLines = 4;
              mainLabel.lineBreakMode = UILineBreakModeWordWrap;
  
              secondLabel.text = [[self.allSectors objectAtIndex:indexPath.row] valueForKey:@"SECTORPCT"];
              secondLabel.adjustsFontSizeToFitWidth = YES;
              secondLabel.numberOfLines = 4;
              secondLabel.lineBreakMode = UILineBreakModeWordWrap;
  
              break;
          case 2:
  
              mainLabel.text = [[self.themes objectAtIndex:indexPath.row] valueForKey:@"THEME_NAME"];
              mainLabel.adjustsFontSizeToFitWidth = YES;
              mainLabel.numberOfLines = 4;
              mainLabel.lineBreakMode = UILineBreakModeWordWrap;
  
              secondLabel.text = [[self.themes objectAtIndex:indexPath.row] valueForKey:@"THEMEPCT"];
              secondLabel.adjustsFontSizeToFitWidth = YES;
              secondLabel.numberOfLines = 4;
              secondLabel.lineBreakMode = UILineBreakModeWordWrap;
  
              break;
  
          default:
              break;
      }
  
      return cell;
  }
  </code></pre>