gpt4 book ai didi

iphone - '接收器() has no segue with identifier 'infoseg'

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:48:34 27 4
gpt4 key购买 nike

最近我的应用程序在切换到下一个 ViewController 时崩溃了。

这是prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

    ShowInfoViewController *secondViewController = (ShowInfoViewController *)segue.destinationViewController;

这就是我调用该方法的方式:

        [self performSegueWithIdentifier:@"infoseg" sender:self];

在界面生成器中,我也有一个具有相同标识符的 segue。

有什么想法吗?

这是日志的打印:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<ViewController: 0x1dda97d0>) has no segue with identifier 'infoseg''

*** 首先抛出调用栈:(0x322982a3 0x31a6a97f 0x34fdbca9 0x1972f 0x1a7fb 0x57d73 0x56ff3 0x5a2f3 0x372c2ef5 0x372029f1 0x3720290d 0x355115df 0x35510ccb 0x35539133 0x321de74d 0x35539593 0x3549d15d 0x3226d683 0x3226cee9 0x3226bcb7 0x321deebd 0x321ded49 0x32f472eb 0x34e24301 0x17427 0x173c8) libc++abi.dylib: terminate called throwing an exception

最佳答案

如果您的目标 View Controller 在导航 Controller 内,您可能想看看这个问题:How to set the delegate with a storyboard .

编辑:从错误来看,您尝试执行的 segue 似乎没有附加到您开始的 View Controller 。尝试删除序列并将其从您的代码所在的 View Controller 拖动到界面构建器中的 ShowInfoViewController。

关于iphone - '接收器(<ViewController :>) has no segue with identifier 'infoseg' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12996504/

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