Storyboard doesn't contain a view controller with identifier

Mat picture Mat · Nov 28, 2011 · Viewed 143.4k times · Source

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 identifier on the UIStoryboard but I'm still getting this error.

enter image description here


Answer

khaliq picture khaliq · Jul 23, 2012

Just for future reference:

I'm developing on iOS 6 using Storyboards.

I was having the same issue, but I could not find the "Identifier" field in the inspector. Instead, just set the field named "Storyboard ID" to what you would name the Identifier. This field can be found under the "Show the Identity inspector" tab in the inspector.

[Note - comments below indicate that some people have found that they need to (also?) set the field "Restoration ID" just below the Storyboard ID in the inspector. Clicking on "Use Storyboard ID" does not seem to be enough.]

There's an image below for reference: (in this instance I've named my identifier the same as my class) enter image description here