当按下表格视图的一行时,我想在故事板的另一个屏幕中移动。
1) 我不想使用导航控制器,还是必须使用?
所以我尝试了这段代码:
UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc=[storyBoard instantiateViewControllerWithIdentifier:@"CenterMain"];
[vc setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentedViewController:vc animated:YES];
在我的里面(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
我收到此警告:
Instance method '-presentedViewController:animated:' not found (return type defaults to 'id')
运行时出现此错误:
MainMap presentedViewController:animated:]: unrecognized selector sent to instance 0x72a2070
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MainMap presentedViewController:animated:]: unrecognized selector sent to instance 0x72a2070'
2)如果使用带有此代码的navigationController:
UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
[[self navigationController] pushViewController:[storyBoard instantiateViewControllerWithIdentifier:@"CenterMain"] animated:YES];
它有效,但问题是我不想在顶部看到导航控制器的栏。
所以我想要么使用 1,要么告诉如何擦除解决方案 2 中的顶部栏。
谢谢!