TranT
TranT

Reputation: 121

SASlideMenu has no segue with identifier null

I am using https://github.com/stefanoa/SASlideMenu to implement a left slide menu in my application. I've followed the tutorial and connected everything as the sample project has. But I keep getting this error:

** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier '(null)''

The error comes form the SASlideMenuLeftMenuSegue

[leftMenu didMoveToParentViewController:rootViewController];
NSString* initiaSegueId = [rootViewController.leftMenu.slideMenuDataSource    initialSegueId];
NSLog(@"initialSegueID->%@",initiaSegueId);
[leftMenu performSegueWithIdentifier:initiaSegueId sender:leftMenu];

Upvotes: 2

Views: 811

Answers (2)

TranT
TranT

Reputation: 121

I've figured it. It happened that I was editing a Storyboard and the changes weren't saved. This was happening because there were 2 different storyboards because of the localization :/ I didn't realize that. That was why I set the segue with that ID and kept getting that error

Upvotes: 0

kschins
kschins

Reputation: 1224

I was having the same problem. I solved it by adding:

-(id) initWithCoder:(NSCoder *)aDecoder{
    if (self = [super initWithCoder:aDecoder]) {
        // Assign self to the slideMenuDataSource because self will implement SASlideMenuDatSource 
        self.slideMenuDataSource = self;
        self.slideMenuDelegate = self;
    }
    return self;
}

I initially left this out and was getting the crash. Add this to assign the delegate and datasource to solve it.

Upvotes: 1

Related Questions