Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detail Disclosure Button and Segues

I'm using a UITableViewController that performs an action sheet upon click, which works great. I'd like to tie the Detail Disclosure to a segue. I created a segue from the cell to the next table, and added the following code:

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
{
    [self performSegueWithIdentifier:@"GroupToGroupMembers" sender:self];
}

Works great when I tap the Detail Disclosure.

Problem is, tapping on the cell now causes both the action sheet AND the segue to fire off, which I would expect.

Anyone figure out how to fire off a segue off of a detail disclosure only?

like image 905
John Avatar asked Nov 10 '11 22:11

John


1 Answers

You probably have the "GroupToGroupMembers" segue hooked up to your UITableViewCell. When you do this, the segue is automatically performed when the cell is selected. This happening in addition to your regular event handling which is showing the action sheet.

Hook your segue up to your UITableViewController instead. This allows you to define your segue so that it may be performed in response to the DetailDisclosure being tapped while, at the same time, preventing the segue from being automatically performed when a cell is selected.

like image 90
KnightHawk Avatar answered Oct 06 '22 15:10

KnightHawk