'Receiver (<ViewController>) has no segue with identifier 'addSegue'

心不动则不痛 提交于 2019-11-26 19:08:10

I had this same problem and actually my problem was that I was calling

WRONG: [self.navigationController performSegueWithIdentifier:@"ShowVerify" sender:self];

instead of

CORRECT: [self performSegueWithIdentifier:@"ShowVerify" sender:self];

so check that you are calling correct performSegueWithIdentifier method :)

Anbu.Karthik

use segue identifier in Push Method and give the proper connection

if you are using Identifier, then call this line where u need

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

Swift 2.X

self.performSegueWithIdentifier("identifierName", sender: self)

Swift 3

self.performSegue(withIdentifier: "identifierName", sender: self)

Regarding the new screen you have added that way. In that screen, when you're finished and want to remove it, it's just:

self.dismiss(animated: false, completion: nil)
JKillian

Hard to say for sure, but some other people have had similar problems:

  • In this question, the asker instantiated the storyboard with init instead of instantiateViewControllerWithIdentifier so the segue wasn't set up properly.

  • In this question, it was just something weird going on internally with xcode and the simulator, and running Product->Clean helped.

  • And of course, it's possible the segue name in the code doesn't match the segue name on the Storybord, but I'm guessing you've checked that a lot of times already!

Check whether UIKIT being or not in header file. I unknowingly made new VC a subclass of View Controller.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!