I have a UITableView that is grouped into sections and has a number of rows in each section, all the rows are disabled so they only show information and they do not allow user interaction except for the very last row. But when the user scrolls through the table the last row is getting copied to some of the other rows in the table. Here is my code.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.userInteractionEnabled = NO;
cell.accessoryType = UITableViewCellAccessoryNone;
UIFont *textLabelFont = [ UIFont fontWithName: @"Arial" size: 13.0 ];
UIFont *detailLabelFont = [UIFont fontWithName:@"Arial" size:13.0];
cell.textLabel.font = textLabelFont;
cell.detailTextLabel.font = detailLabelFont;
// Configure the cell.
[populatePolicyCells ProcessPolicyCell:cell IndexPath:indexPath];
if (indexPath.section == 3){
tableView.allowsSelection = YES;
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.userInteractionEnabled = YES;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
cell.textLabel.text = @"Manage Policy";
}
return cell;
}
Can anyone help?
Set up a different CellIdentifier for your “special cell”