Skip to content

Instantly share code, notes, and snippets.

@timothy1ee
Created January 13, 2014 02:20
Show Gist options
  • Save timothy1ee/8393719 to your computer and use it in GitHub Desktop.
Save timothy1ee/8393719 to your computer and use it in GitHub Desktop.
Example of using prepareForSegue
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
UITableViewCell *selectedCell = (UITableViewCell *)sender;
NSIndexPath *indexPath = [self.tableView indexPathForCell:selectedCell];
Movie *movie = self.movies[indexPath.row];
MovieViewController *movieViewController = (MovieViewController *)segue.destinationViewController;
movieViewController.movie = movie;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment