JaHelia JaHelia - 5 months ago 9
iOS Question

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 ?

Answer

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

UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
Comments