2

Recently my app is crashing when the app switch to the next ViewController.

this is the prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender

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

this is how i call the method :

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

in the interface builder i have a segue with the same identifier as well.

any idea?

this is the log's Print :

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

*** First throw call stack: (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

4

3 回答 3

2

如果您的目标视图控制器位于导航控制器中,您可能想看看这个问题:How to set the delegate with a storyboard

编辑:从错误看来,您尝试执行的 segue 未附加到您开始的视图控制器。尝试删除序列并将其从您的代码所在的视图控制器拖到界面构建器内部的 ShowInfoViewController 中。

于 2012-10-21T15:08:44.827 回答
1

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

于 2015-03-05T21:29:16.633 回答
1

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

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

于 2014-07-05T14:42:49.510 回答