Created
January 13, 2014 02:20
-
-
Save timothy1ee/8393719 to your computer and use it in GitHub Desktop.
Example of using prepareForSegue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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