Created
November 19, 2013 17:30
-
-
Save matteom/7549107 to your computer and use it in GitHub Desktop.
Configuring the managed object context and the delegate for the new controller
This file contains 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
// In PCLeadsViewController | |
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
if ([segue.identifier isEqualToString:@"DisplayLeadSegue"]) { | |
PCLeadViewController *leadViewController = segue.destinationViewController; | |
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow]; | |
leadViewController.lead = self.leads[selectedRowIndexPath.row]; | |
} else { | |
PCNewLeadViewController *newLeadViewController = segue.destinationViewController; | |
newLeadViewController.managedObjectContext = self.managedObjectContext; | |
newLeadViewController.delegate = self; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment