Using storyboards I have a table view controller with a list of rows. When a row is selected, I want to pass the data associated with that row across to another table view controller which is embedded within an UINavigationController.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"EditJob"])
{
NewJobsTableViewController *newJobsTableViewController = segue.destinationViewController;
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
Jobs *job = [self.fetchedResultsController objectAtIndexPath:indexPath];
newJobsTableViewController.jobDetails = job;
}
}
On the last line within the prepareForSegue method I am getting the following error:
[UINavigationController setJobDetails:]: unrecognized selector sent to instance 0x83a7780
2012-11-11 08:50:25.335 My Trades[40612:c07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationController setJobDetails:]: unrecognized selector sent to instance 0x83a7780'
jobDetails is declared in the newJobsTableViewController as:
@interface NewJobsTableViewController : UITableViewController <UITextFieldDelegate, NSFetchedResultsControllerDelegate> {
Jobs *_jobDetails;
}
@property (strong, nonatomic) Jobs *jobDetails;
I am not sure why it's causing this error.