title: Have to press detail disclosure button twice for data to be passed using prepareForSegue method
body: <p>EDIT: I have fixed this problem. The code is corrected to show this fix.</p>
  
  <p>I have an app that uses a UITableViewController that displays a list of all 50 states separated into sections alphabetically. I have added the detail disclosure button to the prototype cell in the storyboard and the table displays all the correct information. </p>
  
  <p>When I press the button on a cell, it should segue to a new viewController and display the name of the state as the view title and then display a picture of the license plate in the view.</p>
  
  <p>I am using the -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath method to control the button press and then I am using the -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender to control the values being passed to the new viewController.</p>
  
  <p>The problem I am having is that when I press the detail disclosure button nothing gets passed. NSLogging the values in the new viewController outputs (null), (null) and the view has no title or picture. However, when I press back and then press the same cell's detail disclosure button a second time, it works like it should. The title is correct and the picture displays properly.</p>
  
  <p>The same is true when I choose another cell, the viewController displays the last information sent and I have to press back and then choose the cell again for it to update. When choosing a different cell for the first time, (null, (null) is what the NSlog is outputting. So I believe what is happening is that the first time a detail disclosure button is pressed, no values are passed, but the second time it is pressed, the values are being passed. </p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
  {
      //Don't even use this method now.
  }
  
  -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
  UITableViewCell *cell = (UITableViewCell*)sender;  //Added this line
  self.path = [self.tableview indexPathForCell:cell]; //Added this line
  
  if ([segue.identifier isEqualToString:@"stateSegue"])
      {
          self.controller = segue.destinationViewController;
          self.controller.stateName = [self.stateArray[indexPath.section][indexPath.row]stateName];
          self.controller.licensePlateURL = [self.stateArray[indexPath.section][indexPath.row]licensePlateURL];
      }
  }
  </code></pre>
  
  <p>Any help with this would be greatly appreciated.</p>