This is a common mistake.
You are dequeueing a reusable cell. It will be in whatever state it was when it was added to the queue (or cache, if you prefer).
You need to add an else
block of code in the configureCell:
method:
- (void)configureCell:(CustomTableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
Item *item = [self.items objectAtIndexPath:indexPath];
cell.titleLabel.text = item.title;
if (!item.enabled.boolValue) {
cell.backgroundColor = [UIColor colorWithRed:0.999 green:0.895 blue:0.452 alpha:1.000];
}
else
{
// Set cell.backgroundColor to the enabled color
}
}