I am trying to pass data from one UITableViewController
to another. This is my code in the initial view controller:
- (void)tableView:(UITableVi
That's good, but now you need to add this:
First instead of:
[self performSegueWithIdentifier:@"showDetail" sender:self];
You need to send the object:
[self performSegueWithIdentifier:@"showDetail" sender:subject];
Add a property in your ListsViewController.h:
@property (nonatomic, strong) Subject * subjectSegue;
And now in your first view controller:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"showDetail"]) {
ListsViewController * lists = (ListsViewController *)[segue destinationViewController];
lists.subjectSegue = sender;
}