使用tableview并尝试打开 collectionviewcontroller,其中包含导航控制器的故事板和根视图控制器,当按下tableview单元格时。但是收到错误消息
应用程序试图在目标上推送一个nil视图控制器
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIViewController *viewController;
switch (indexPath.row) {
case PDF:
viewController = [[[PDFExampleViewController alloc] init]autorelease];
break;
case IMAGE:
//Rootviewcontroller of the navigation controller have no identifier. showDetail is the segue of the rootviewcontroller.
viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"showDetail"];
break;
case PROCEDURAL:
viewController = [[[ProceduralExampleViewController alloc] init] autorelease];
break;
default:
viewController = [[[UIViewController alloc] init] autorelease];
}
[self.navigationController pushViewController:viewController animated:YES];
}
感谢您的帮助。