I am attempting to use a storyboard/segue to handle the transition between a UITableView with both standard transition as well as detail disclosure button. Having read a few different posts on here I have set up my project this way:
- Tie main segue between UITableViewCell and ViewController
- Tie secondary segue from parent ViewController to new ViewController
Implement
accessoryButtonTappedForRowWithIndexPathas follows:-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { [self performSegueWithIdentifier:@"DetailSegue" sender:self]; }
This works great and my prepareForSegue: sender: gets called as expected. The trouble is, I need to know the indexPath for the element selected. The segue from the UITableViewCell retrieves the indexPath like this:
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
Unfortunately when I try to do that having called the accessoryButton, that returns null.
The original question I am basing some of this code off of is here: Detail Disclosure Button and Segues
Is there a method of the tableView which returns indexPath for accessoryButtons? Do I need to access the indexPath in some other manner?