'接收者( )没有跟随标识符'infoseg'

问题描述 投票:2回答:3

最近我的应用程序在应用程序切换到下一个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:终止叫做抛出一个异常

iphone ios uistoryboardsegue
3个回答
2
投票

如果您的目标viewcontroller在navigationcontroller中,您可能想看看这个问题:How to set the delegate with a storyboard

编辑:从错误看起来你想要执行的segue没有附加到你开始的viewcontroller。尝试删除seque并将其从您的代码所在的viewcontroller拖到ShowInfoViewController内部界面构建器中。


1
投票

我有一个类似的问题 - 事实证明我在故事板上的segue标识符上有一个尾随空格。

例如。 'SequeIdentifier' - 当然这在XCode中很难看到


1
投票

有同样的问题。意识到我在AppDelegate.m和Storyboard中设置了根控制器。删除了AppDelegate.m中的代码并修复了它。

© www.soinside.com 2019 - 2024. All rights reserved.