I have a UITableView that is being populated from an NSMutable array that has 79 entries in it. When I run my app and scroll down the table there seems to be multiple entries in one cell. It seems to happen about a screen height and a half down the table.
For example:
One object in the array is @"Dog" and another is @"Cat". In one cell you can see both Cat and Dog written in the cellLabel text.
Code for init'ing the cells
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryNone;
}
// Configure the cell...
UILabel *cellLabel = [[[UILabel alloc] initWithFrame:cell.frame] autorelease];
cellLabel.text = [symptomsArray objectAtIndex:indexPath.row];
cellLabel.textColor = [UIColor blackColor];
cellLabel.backgroundColor = [UIColor clearColor];
cellLabel.opaque = NO;
[cell.contentView addSubview:cellLabel];
cell.contentView.backgroundColor = [UIColor colorWithRed:(214.0/255) green:(215.0/255.0) blue:(217.0/255) alpha:1.0];
return cell;
}