UITableView Detect Selected Cell?

I have multiple UITableViews in my app, is there a method of detecting which cell/row the user has selected in that column?

Also is it possible to programatically deselect a cell/row?

Thanks.

Answers


Get currently selected index path for a table:

NSIndexPath *path = [tableView indexPathForSelectedRow];

Deselect currently selected row:

[tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:YES];

Need Your Help

render form only for nested model

ruby-on-rails-3 nested-forms nested-attributes form-for nested-form-for

I have a model named property and a nested model PropertyReviews. I am able to render a single form with property and property_reviews. A property can have multiple reviews, so when I want to add a...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.