2022-04-24

Segue Identifier is going missing in Swift 5.6

I've only been programming for a month, and I am trying to cobble together a mockup and I keep getting the following error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<OutsizeMockup_0_1.HomeViewController: 0x13460f870>) has no segue with identifier 'testSegue''

I get this when I have my segue transition: self.performSegue(withIdentifier: "goToProducts", sender: self) within my buttonWasPressed method(which is called after my URLSession is created), but not when I call it within any other button that's not nested in Session. So I know the identifier is spelled correctly and under the right view controller class. I'll post my code below.

My project layout

First the browse button is pressed and the fetchDrop method is called:

HomeViewController where button is pressed

Then, the class that manages the url session is called: DropManager class with url session. Using this data, pM.initializeProducts is called, leading to the next file

Finally, buttonIsPressed is called here. And once it's called, the segue within the HomeViewController gets the error that I mentioned above

I'd be interested to know if there are any glaring issues with my code.



No comments:

Post a Comment