I am trying to pass data from one UITableViewController
to another. This is my code in the initial view controller:
- (void)tableView:(UITableVi
You need to understand that performSegueWithIdentifier:sender:
creates a new instance of view controller. So the ListsViewController
that you have created is not the being displayed on the screen.
You need to override `prepareForSegue:sender:
- (void)showList:(Subject *)subject animated:(BOOL)animated
{
[self performSegueWithIdentifier:@"showDetail" sender:self];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"showDetail"]) {
ListsViewController *controller = (ListsViewController *)segue.destinationViewController;
controller.subject = self.subject;
}