OGeek|极客世界-中国程序员成长平台

标题: ios - 如何使用 Storyboard 将两个 View Controller 连接到一个 View Controller ? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 11:06
标题: ios - 如何使用 Storyboard 将两个 View Controller 连接到一个 View Controller ?

我正在尝试将两个 View Controller 连接到一个 Controller 中。如下图所示,当点击“加号”项目时,屏幕出现并且效果很好。但是,另一个 segue 不能正常工作。当我第一次点击任何行时,它不会带我进入 View ,但在第一次点击后它会开始按我的意愿将我带到 View 。当我第一次点击任何一行时,我无法弄清楚为什么它没有带我去。这是 didSelectRowAtIndexPath 代码:

- (void)tableViewUITableView *)tableView didDeselectRowAtIndexPathNSIndexPath *)indexPath{
    DovizDetailViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier"detail"];
    [self.navigationController pushViewController:detail animated:YES];
}

下面是我的 Storyboard。问题出在上面的观点上,而且是segue。

Two view connected to one

希望你能帮助我。

谢谢!



Best Answer-推荐答案


didDeselectRowAtIndexPath 更改为 didSelectRowAtIndexPath

关于ios - 如何使用 Storyboard 将两个 View Controller 连接到一个 View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31025895/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4