Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any difference between UITableViewCellAccessoryDetailDisclosureButton and UITableViewCellAccessoryDisclosureIndicator

I have created a method - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { for UITableViewCellAccessoryDetailDisclosureButton.

Now I want to use UITableViewCellAccessoryDisclosureIndicator in place of UITableViewCellAccessoryDetailDisclosureButton.

Is there any difference between UITableViewCellAccessoryDetailDisclosureButton and UITableViewCellAccessoryDetailDisclosureButton?

like image 768
Varsha Avatar asked Oct 11 '11 04:10

Varsha


2 Answers

Apple HIG suggests that you use UITableViewCellAccessoryDisclosureIndicator to navigate through hierarchical data, and UITableViewCellAccessoryDetailDisclosureButton to perform some action, possible bringing up an edit view, that may change the data. However, most programmers seem to ignore this.

You can implement the delegate method tableView:didSelectRowAtIndexPath: like this:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
    [self tableView:tableView didSelectRowAtIndexPath:indexPath];
}

Or vice versa.

like image 68
Paul Lynch Avatar answered Sep 29 '22 04:09

Paul Lynch


There is difference. UITableViewCellAccessoryDetailDisclosureButton is actually a button but UITableViewCellAccessoryDisclosureIndicator is not.

You can use UITableViewCellAccessoryDisclosureIndicator instead of UITableViewCellAccessoryDetailDisclosureButton but you can not get the tableView:accessoryButtonTappedForRowWithIndexPath: method called when you tap on the UITableViewCellAccessoryDisclosureIndicator as it is not a button.

like image 20
EmptyStack Avatar answered Sep 29 '22 04:09

EmptyStack