views:

146

answers:

1

Hi All,

I have a table and row contents(hard coded contents). when i choose one row and see the content and then come back to same table and try to choose another row, it doesn't deselect the first row selection(by default it shows Blue selection-UITableViewCellSelectionStyleBlue), instead both the rows are being in selected mode. I was hoping, when we choose one row and then choose another row, by default it should unhighlight immediately the previous row selection.

Why and when should it happen? I tried code 'cell.selectionStyle = UITableViewCellSelectionStyleNone;' and tableView.allowsSelection=NO; but no success, these are just not allowing completely from selection view.

I want when one row is selected and then the another is getting selected, the first row selection should be cleared and should show only the current row selection.

Any help please?

+1  A: 

In your tableView:didSelectRowAtIndexPath: method or in the method you call when entering edit mode (the one containing [tableView setEditing:YES animated:YES];), add the following line:

[tableView deselectRowAtIndexPath:indexPath animated:YES];

before pushing a new controller.

unforgiven
Thank you very much. Working Great!
Clave Martin