Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView/UITableViewCell tap event response?

I've been googling around to try to figure out what sort of event handles are called when one row (or cell) in a UITableView is tapped, but haven't been able to figure it out. I'm trying to change the image property of the cell when it's tapped.

Thanks.

like image 866
Arman Avatar asked Dec 11 '09 16:12

Arman


1 Answers

There are two possible events when a table row is tapped: selecting the row and the accessory view (usually the "more details" type action).

As long as you have registered a delegate for the UITableView, the following can be implemented and will be called on a touch:

// Tap on table Row
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath { ... }

// Tap on row accessory
- (void) tableView: (UITableView *) tableView accessoryButtonTappedForRowWithIndexPath: (NSIndexPath *) indexPath{ ... }
like image 62
MystikSpiral Avatar answered Oct 01 '22 21:10

MystikSpiral