gpt4 book ai didi

iphone - 如何在 storyBoard 中添加 navigationController Controller

转载 作者:行者123 更新时间:2023-11-29 11:02:44 25 4
gpt4 key购买 nike

我有 3 个 View Controller 。我的第一个 View Controller 我的意思是 Root View Controller 是普通 View Controller ,而不是导航 Controller 。我希望我的第二个 View Controller 作为导航 Controller 来推送第三个和第四个 View Controller 。下图显示了我的故事情节,但是当我导航时它不起作用,请指导我哪里做错了。

这是我用来导航到另一个 View Controller 的代码

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ViewController2 *yourViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController2"];
[self.navigationController pushViewController:yourViewController animated:YES];

}

enter image description here

最佳答案

将第一个 View Controller 连接到导航 Controller 并以模态方式呈现。然后将导航 Controller 连接到 TableView Controller 。将 tableViewCell 连接到详细 View 并推送它

enter image description here

关于iphone - 如何在 storyBoard 中添加 navigationController Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15128973/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com