Skip to content

Instantly share code, notes, and snippets.

@romyilano
Forked from hacksoldier/Prepare For Segue
Last active January 1, 2016 04:19
Show Gist options
  • Save romyilano/8091068 to your computer and use it in GitHub Desktop.
Save romyilano/8091068 to your computer and use it in GitHub Desktop.
Damn, always forget this one. the selected table row for is the indexPathForSelectedRow:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showDetail"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
NSManagedObject *object = [[self fetchedResultsController] objectAtIndexPath:indexPath];
[[segue destinationViewController] setDetailItem:object];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment