I've looked at dozens of answers to this problem on this very site but I still can't get it to work. I, like many before me, want to change the color in a few cells in a table view. I tried putting a conditional if (indexPath.row == ...) then change the color of a few cells to red, but this always results in other cells gradually becoming red changing the more I scroll. I tried moving this code from:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
To here:
- (void)tableView: (UITableView*)tableView willDisplayCell: (UITableViewCell*)cell forRowAtIndexPath: (NSIndexPath*)indexPath
But this still doesn't work. How can I change the colors of cells, say, 5. 13, and 40 to be red?