Reputation: 151
i need to do something on accessoryType
click in tableview in iphone.how can i find accessoryType
click in UITableView
in iphone.
Upvotes: 6
Views: 1474
Reputation: 10011
you need to define the accessoryType
of the cell in the
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
like this
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
the method for row selection of this accessoryType is
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
but if you are defining any other accessoryType for cell than you can use this method.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
Upvotes: 9
Reputation: 12787
use this delegate method for this purpose
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
This fires when you click on accessory
Upvotes: 6