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.
Related
I'm getting this follow message when I try open a table item in my 'add' form to update it.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'verBeneficioSegue''
Github with project: https://github.com/felipeejunges/MyBenefits
Segue:
My code:
When I was debbuging I got error in line 58.
P.S. I'm doing a project exercise for my post-degree in iOS.
I try to clean up project, restart Xcode, restart my Mac, but nothing worked.
From the crash the segue is inside vc named ListarBeneficiosTableViewController
ListarBeneficiosTableViewController: 0x7fbf6d510340>) has
no segue with identifier 'verBeneficioSegue'
and your vc shown in picture is named MyBeneficio ( it's a UITaBarController ) which isn't the same hence the crash
If your purpose is to add another tab to the tabs controller you should drag the segue from the tab to the listoVC and select viewControllers from the popup
Otherwise the segue origin should be ListarBeneficiosTableViewController and it's destination is another vc
You are saying
self.performSegue(withIdentifier: "verBeneficio", sender: beneficio)
in your ListarBeneficiosTableViewController class. This implies that your ListarBeneficiosTableViewController instance is loaded from the storyboard and in the storyboard it has a segue called "verBeneficio".
Okay, so let's look in the storyboard. When we do, we see that the "verBeneficio" segue does not come from the ListarBeneficiosTableViewController. It comes from the tab view controller.
I'm working in a new Swift project, where I'm trying the simple task of executing a segue whenever a button is pressed. However, whenever I try to trigger the segue, the following error pops up:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<Ma2Mi.LandingViewController: 0x7f99c65122b0>) has no segue with identifier 'showLogin''
Relatively simple, except for that there's actually a segue named showLogin:
(the top view controller is of type LandingViewController.)
This is how the segue is invoked:
loginButton.addAction {
self.performSegue(withIdentifier: "showLogin", sender: nil)
}
How is it possible that such a simple task is failing? Perhaps a bug, or something I overlooked?
Thanks.
Did you use the required init() function on the ViewController triggering the segue? I had the same issue until I removed it.
Trying to move from my first ViewController to my second ViewController (both using same storyboard), using a segue. My first ViewController has two buttons, one that says "Male", one that says "Female" (I know, not everyone associates with one of these two), and I want either, once clicked, to move to the second ViewController. I drag/dropped the button into my code to get the following:
#IBAction func femaleButton(_ sender: AnyObject)
{
Globals.onboardingList.append("girl")
print("it's a girl!")
performSegue(withIdentifier: "femaleSegue", sender: self)
}
The Male button is identical. Using printlines I know that the program works until the "performSegue" line. I added visual segues and put their identifiers as maleSegue and femaleSegue. However, I am getting the following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[Train.SecondVC
_setViewDelegateContentOverlayInsetsAreClean:]: unrecognized selector
sent to instance 0x7fc482d02b00'
Thanks so much for any help!
In my case I got this error because I had made a custom ViewController class and mistakenly assigned it to the View in the Storyboard instead of the ViewController. Check your Storyboard View and ViewControllers for custom classes and make sure you've set them appropriately.
I can't figure the real problem as i believe you are not using the right identifier or made the segue connection from storyboard from the wrong view controller, however to make sure, please make one segue ctr + click on the button and drag it to the second screen and comment your action, if this works then remove that segue and the previous two segues and do it again but focus this time :)
I previously transistioned from one VC to another by:
Creating a button
Ctrl-drag the button to the new VC
Select Custom
That was it and it worked. Now however, I am trying this again on a new app and I am getting the error : * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not perform segue with identifier '(null)'. A segue must either have a performHandler or it must override -perform.'
* First throw call stack:
Is there something I need to add since Swift2.0?
With custom segue type, u have to give it indentifier and custom handler, if not, choose show type if u have Navigation Controller or show modally type , that wont need to name or add anything else and it will just work
U can read more about custom segue here or here
Definition of (the relevant part in) my app:
I have map in my view (MAP). User clicks a view, app reverse geocodes to get the address and segues to another view (PICKER), it lets user select from picker the name she wants for the place or go to another view and give custom name (CUSTOM).
Problem is that when I try to unwind from CUSTOM it fails.
In custom I unwind to the same method as from PICKER that I have in MAP's controller i.e.
#IBAction func unwindCancel(segue:UIStoryboardSegue) {
// do nothing as saving was cancelled
return
}
#IBAction func unwindSave(segue:UIStoryboardSegue) {
self.reloadGeodesics()
}
Below I present how I made in the storyboard the unwinding, i.e. ctrl drag Cancel (and Save) to exit and select corresponding Action segue.
These are my error messages
2015-11-02 14:58:59.753 via[19620:2883125]
-[via.LocationNamePickerViewController unwindSave:]: unrecognized selector sent to instance 0x7bb35770
2015-11-02 14:58:59.789 via[19620:2883125] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason:
'-[via.LocationNamePickerViewController unwindSave:]: unrecognized
selector sent to instance 0x7bb35770'
when I click save. via is my app name and LocationNamePickerViewController is the controller of PICKER.
I have looked many tutorials and to me I seem to be doing everything right.
Is this a problem of doing the segue from clicking Other in PICKER to CUSTOM wrongly? Does the navigation controller between the MAP and PICKER crash the compiler? From the error it looks like PICKER's controller cannot delegate the action segue call to the MAP's controller. Can this happen and if it happens how can it be fixed? Everything works fine in the PICKER, the problem is just with unwinding the CUSTOM.
The way you create unwind segue is not right,you should create segue like this
Control + drag from Location Enter VC to Map Exit
Gif
Hope this will help you
You placed UINavigationController after Map View, so LocationNamePicker controller and Location Name Enter controller is on stack of that navigation controller, so it seems it doesn't recognize Map View Controller's unwind action even you selected that action in storyboard.
Why don't you put navigation controller before Map View Controller?
I think it will not crash then.