Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSInvalidArgumentException reason Receiver has no segue with identifier

Tags:

I have problem I've been sitting with. I have a UIViewController List and a UIViewController Login. On Login I have a button "Done", also another hidden button on the same UIViewController that has a segue to List (Type: push). I gave it an identifier in the interface builder of xcode named "LoginToList". Now from another class (a class that runs while Login is the active controller) I call:

[[Login sharedLogin] performSegueWithIdentifier:@"LoginToList"];

The Login class clearly has a segue with identifier "LoginToList"

Yet I keep getting:

 'NSInvalidArgumentException', reason: 'Receiver (<Login: 0x6d79d90>) has no segue with identifier 'LoginToList''

the + (id) sharedLogin looks like this:

+ (id) sharedLogin {
    static Login *sharedLogin = nil;

    @synchronized(self) {
        if (sharedLogin == nil) {
            sharedLogin = [[self alloc] init];
        }

        return sharedLogin;
    }
}

If anyone has any idea why it says that, I'd be glad to hear it! :D I don't know if I'm missing something stupid but I can't spot it :(

EDIT: I have create a segue in the interfacebuilder (ctrl + click drag from Login to List) using the UIViewControllers themselfves (Login & List). Then I named the segue "LoginToList" in other words I gave it that identifier. I clicked the segue and at the top-right there was a "Identifier" field which I used.

I Still get the error saying Login has no segue with identifier "LoginToList". sad