0
votes

I have two different storyboards named "MainStoryboard" and "TPStoryboard". In TPStoryboard, I have set CCViewController as my initial view controller (names are changed here).

In MainStoryBoard, I have a tableView, and when user selects a cell, he is expected to land in the initial view controller of TPStoryboard. The following is the code I have written:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath     {
        UIStoryboard *stb = [UIStoryboard storyboardWithName:@"TPStoryboard" bundle:nil];
        CCViewController *ccv = [stb instantiateInitialViewController];
        [self.navigationController pushViewController:ccv animated:YES];
}

This gives the exception

"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'TPStoryboard' in bundle NSBundle"

1
Start by not catching the exception, and actually letting your program crash so you can know exactly what went wrong. - Carl Veazey
Yep, did as you suggested and got the exception, which I posted in the question under "EDIT" - thandasoru
Is the storyboard added to the target? - Carl Veazey
My mistake, it wasn't added :-( - thandasoru

1 Answers

1
votes

The error states that there's not such file in the bundle, so it's very likely that you are either misspelling the name or that the storyboard file is not included in the target.