我想从一个 viewController 跳转到另一个。我一直在使用 performSegueWithIdentifier
并且它适用于所有期望的 viewControllers。每次应用程序尝试执行 segue 时,它都会打印此错误:
2016-08-21 15:04:29.170 onboarding[44226:2490189] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'gogo''
我在 segue 中的标识符是“gogo”。同样在我的代码中,我使用:
self.performSegueWithIdentifier("gogo", sender: self)
如果您仔细查看错误消息,我注意到 Xcode 向标识符添加了撇号。是打印“gogo”而不是“gogo”。为什么会这样?
最佳答案
首先,它不会添加另一个 '.仔细看看这部分:
reason: 'Receiver (<onboarding.QuestionnarieVC: 0x7fa919874a00>) has no segue with identifier 'gogo''
额外的'来自'Receiver ....'
你确定你已经为正确的segue设置了正确的segue ID吗?
关于ios - 使用 performSegueWithIdentifier() 向标识符添加撇号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39068934/