Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unselect an object from a UITableView?

I was wondering how I could unselect an object from my UITableView. One of the cells is highlighted, or selected, and I want to unselect it so that none of the UITableView cells are selected. How could I do this?

like image 311
Blane Townsend Avatar asked Dec 07 '25 12:12

Blane Townsend


2 Answers

You can do this:

[yourTableView deselectRowAtIndexPath:[yourTableView indexPathForSelectedRow] animated:NO];
like image 166
dredful Avatar answered Dec 10 '25 02:12

dredful


If you gain a reference to the cell, you can also call

cell.selected = NO;
like image 36
Jamie Avatar answered Dec 10 '25 01:12

Jamie