Question

I have 3 view controllers in a part of my storyboard. I also have 2 push segues, one switches the first view controller to the second one, and the other one switches the second view controller to the third one.

I perform both segues programmatically, and I have set all three view controllers to use the same custom class ( Called RegViewController ).

Everything works fine with the first segue, but the second one throws an exception saying

Crash: Receiver (<RegViewController: 0xab74b50>) has no segue with identifier 'a'

I set the identifier for second segue to "a" to make sure it is short and I'm not making any mistake.

Anyways, I'm sure that my view controller has a push segue with that identifier and I dunno if I'm making any mistake logically !

Any ideas ?

Was it helpful?

Solution

Found the problem :

Assigning 3 view controllers to same custom class, results in errors when you're trying to perform a segue, because the segue with desired identifier is not created from every view controller using that custom class. Using different custom classes would solve the problem.

OTHER TIPS

check your segue identifier. because your segue identifier doesn't same in your code or you are declared identifier name different on your storyboard

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top