Отправитель, которого вы используете для подготовки к передаче, может быть любым, кем вы захотите. Если вы хотите узнать строку, отправьте строку или путь индекса:
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
NSUInteger rowNumber = [indexPath row];
NSString *categoryCode = [self.categoryCodes objectAtIndex:rowNumber];
self.categoryData = [self.commuterDict objectForKey:categoryCode];
[self performSegueWithIdentifier:@"ShowPlaces" sender:indexPath];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"ShowPlaces"]) {
PlacesViewController *placesViewController = [segue destinationViewController];
// Row information is supplied as the sender
NSIndexPath *indexPath = sender;
}
}
Если вы хотите использовать фактическую строку, то сделайте это отправителем
[self performSegueWithIdentifier:@"ShowPlaces" sender:[tableView cellForRowAtIndexPath:indexPath]];