NSInvalidArgumentException reason Receiver has no segue with identifier NSInvalidArgumentException reason Receiver has no segue with identifier xcode xcode

NSInvalidArgumentException reason Receiver has no segue with identifier


As far as your code snippet goes, it looks like you tried to create a singleton out of the Login Controller, but only did it half way.

The seque can't be found because the the Controller was initialized using the storyboard, not using your shared class method. So you end up having two independent instances. Additionally, your class method does not initialize the controller with the storyboard bindings, so you don't have any seques here.

You should try to hand a reference of the LoginController's instance (initialized unsing storyboard segues etc.) to the 'other class' and use that one.


sharedLogin = [[self alloc] init];

try this

sharedLogin = [self.storyboard instantiateViewControllerWithIdentifier:@"xxxx"];

you must set IdentifierName in storyboard LoginViewController


without knowing about what your init does ...

i found in attempting to dynamically [[alloc] init] a view controller for use like this, i had to call initWithNibName:bundle:, and thus i had to put my view controller in a separate xib class so it didn't get confused in the storyboard and leave warnings about an unreachable scene.

without initWithNibName:bundle:, my guess is that your call to [[alloc] init] in sharedLogin is not properly tying the UIStorybardSegue* that you you have clearly created to the Login view controller in a way that it can be used from the object returned .

(my situation is that i had a popover in iPad and a regular navigation segue in iPhone. for iPhone, i am using the hidden button with segue in iPhone, but it is performing a segue to a scene and view-controller that undoubtedly gets initialized in awakeFromNib: . for iPad, i'm putting into a popover, and the popover isn't connected to anything … and gets initialized with initWithNibName:bundle: to the item that is in a separate .xib file.]