Trying to do something I\'ve seen documented in a lot of places, but can\'t seem to manage. I\'m trying to pass data from one view to another during a segue.
Here\'s
you can achieve it by doing this: first pass the value you want to send to the destination controller here:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self performSegueWithIdentifier:@"segueToLocation" sender:the object you want to pass];
}
then get the object here
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString: @"segueToLocation"]) {
DetailViewController *dest = (DetailViewController *)[segue destinationViewController];
//the sender is what you pass into the previous method
dest.target=sender
}
}