- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *selectedString = nil;
if ([tableView isEqual:self.tableView]) {
selectedString = self.strings[indexPath.row];
} else if ([tableView isEqual:self.searchDisplayController.searchResultsTableView]) {
selectedString = self.searchResults[indexPath.row];
} else {
return;
}
[self performSegueWithIdentifier:kSegue
sender:selectedString];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
NSString *segueIdentifier = segue.identifier;
if ([segueIdentifier isEqualToString:kSegueId]) {
STDetailViewController *destinationViewController = segue.destinationViewController;
destinationViewController.detailString = sender;
}
}
sender == self.searchDisplayController.searchResultsTableView
[sender isEqual:self.searchDisplayController.searchResultsTableView]