mat mat - 6 months ago 80
Objective-C Question

STORYBOARD - doesn't contain a view controller with identifier

I keep getting the following error:

Storyboard (<UIStoryboard: 0x7ebdd20>) doesn't contain a view controller
with identifier 'drivingDetails'

This is the code:

- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"drivingDetails"];
controller.title = [[dao libraryItemAtIndex:indexPath.row] valueForKey:@"name"];
[self.navigationController pushViewController:controller animated:YES];

I have already set the
on the
but I'm still getting this error.

enter image description here

mat mat

Fixed! Not only the identifier in the segue must be set, in my case DrivingDetails, but also the identifier in my tableViewController must be set as DrivingDetails...check my picture:

enter image description here

I also removed the navigation view controller so now the 2 table view controllers are connected directly with a "push" animation.

*****EDIT for XCODE 7.0*****

you have to set the storyboardId(in this case the viewController is embedded in a Navigation controller:

let lastMinVc  = mainStoryBoard.instantiateViewControllerWithIdentifier("lastMinuteNavController") as! UINavigationController

enter image description here