使用performSegueWithIdentifier()将撇号添加到标识符

Jor*_*mez 0 xcode ios segue swift

我想从一个viewController跳到另一个.我一直在使用performSegueWithIdentifier,它适用于所有viewControllers期望的一个.每次应用程序尝试执行segue时都会显示以下错误:

2016-08-21 15:04:29.170入职[44226:2490189]***由于未捕获的异常'NSInvalidArgumentException'终止应用程序,原因:'Receiver()没有标识符'gogo''的segue

我在segue中的标识符是"gogo".在我的代码中我使用:

self.performSegueWithIdentifier("gogo", sender: self)
Run Code Online (Sandbox Code Playgroud)

如果你仔细查看错误消息,我注意到Xcode在标识符中添加了一个撇号.打印'gogo''而不是'gogo'.为什么会这样?

tec*_*242 5

首先,它不会添加另一个'.仔细看看这部分:

reason: 'Receiver (<onboarding.QuestionnarieVC: 0x7fa919874a00>) has no segue with identifier 'gogo''
Run Code Online (Sandbox Code Playgroud)

额外的'来自'接收者......'

您确定已将正确的segue ID设置为正确的segue,如下所示:

在此输入图像描述