Reputation: 9140
I'm adding a split ViewController with the table view and detail view:
The tableview works fine the cell are been populated and everything but when one of the cells is been selected I get the error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<masterViewController: 0x15ce0e9b0>) has no segue with identifier 'detailView''
Here is my code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"detailView" sender:[_arrayOfFiles objectAtIndex:indexPath.row]];
}
Here is the info of the detailView:
I add identifier to the storyboard segue:
but now I'm getting the following error:
* Terminating app due to uncaught exception 'NSGenericException', reason: 'Could not find a navigation controller for segue 'show tableVIew'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.' * First throw call stack:
Upvotes: 1
Views: 866
Reputation: 2894
If I'm not wrong you should be adding a Navigation Controller to bot the Master
and Detail View Controllers
.
Additionally, for a split controller to function it must be set as the root controller.
Good luck!
Upvotes: 0
Reputation: 21536
You need to set the identifier for the segue, not the viewController. If you click on the line joining the two viewControllers, you can then set the attributes for the segue in the attributes inspector:
Upvotes: 2