title: Getting same records from UITableView on Detail Button click in iOS
body: <p>I am newbie to iOS and learning things in iOS. I am making a demo of <code>UITableView</code> and Segue. I have successfully implemented table-view and now I want to pass the value to another View Controller using segue. I have tried as below, but my problem is I am getting same record every time on detail button clicked from <code>UITableView</code>. I don't have any idea what is wrong in my code.</p>
  
  <p>Can anybody help me to figure it out?</p>
  
  <p>I am posting my code here:</p>
  
  <p><strong>code</strong></p>
  
  <pre><code>-(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
  
      //NSDictionary *dict = [myArray objectAtIndex:indexPath.row];
    //  NSString *name = [dict valueForKey:@"name"];
  
  
      [self performSegueWithIdentifier:@"detail" sender:self];
  
  }
  - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
      if ([segue.identifier isEqualToString:@"detail"]) {
          NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
          //NSLog(@"selected index path==%@",indexPath);
          DetailView *destViewController = segue.destinationViewController;
          destViewController.details = [myArray objectAtIndex:indexPath.row];
      }
  }
  </code></pre>