我有两个不同的故事板,名为“MainStoryboard”和“TPStoryboard”。在 TPStoryboard 中,我将 CCViewController 设置为我的初始视图控制器(名称在此处更改)。
在 MainStoryBoard 中,我有一个 tableView,当用户选择一个单元格时,预计他会进入 TPStoryboard 的初始视图控制器。以下是我编写的代码:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIStoryboard *stb = [UIStoryboard storyboardWithName:@"TPStoryboard" bundle:nil];
CCViewController *ccv = [stb instantiateInitialViewController];
[self.navigationController pushViewController:ccv animated:YES];
}
这给出了例外
“由于未捕获的异常‘NSInvalidArgumentException’而终止应用程序,原因:‘在捆绑包 NSBundle 中找不到名为‘TPStoryboard’的故事板”