mat mat - 1 year ago 203
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
Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download