user2924482
user2924482

Reputation: 9140

error "has no segue with identifier" adding split ViewController

I'm adding a split ViewController with the table view and detail view:

storyBoard

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:

enter image description here

I add identifier to the storyboard segue:

enter image description here

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

Answers (2)

carlodurso
carlodurso

Reputation: 2894

If I'm not wrong you should be adding a Navigation Controller to bot the Master and Detail View Controllers.

screenshot

Additionally, for a split controller to function it must be set as the root controller.

Good luck!

Upvotes: 0

pbasdf
pbasdf

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:

enter image description here

Upvotes: 2

Related Questions