I have a tableview and when I select one cell I am changing the backgroup color of that cell to identify the selected row.
My problem is: I am reloading the table view when I select the next row, at this time I am unable to change the background color of that cell.
I wrote the below code in cellForRowAtIndexPath: method:
if (m_selectedCell == indexPath.row) {
[cell setBackgroundColor:[UIColor redColor]];
}
Can anyone please help on this?
write your code just before you return cell. and also check the m_selectedCell assigns or nil?
if value is match then add a UIImageView with background color in cell.