Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reach the current selected cell in didSelectRowAtIndexPath?

I want to change the accessory view type of a cell through the method: didSelectRowAtIndexPath , i.e. when a row is selected I want to change the accessory view type, can I do this inside that method ?

like image 304
JaHelia Avatar asked Jul 01 '11 10:07

JaHelia


People also ask

How do I get a cell in Didselectrowat?

Use the below function and pass the index path of the selected row so that the particular cell is reloaded again. Another solution: store the selected row index and do a reload of tableview. Then in cellForRowAtIndexPath check for the selected row and change the accessory view of the cell.


1 Answers

You can get the cell from didSelectRowAtIndexPath: method using the indexPath like this.

UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; 
like image 95
EmptyStack Avatar answered Sep 16 '22 16:09

EmptyStack