iOS-Slide-Menu icon indicating copy to clipboard operation
iOS-Slide-Menu copied to clipboard

SlideNavigationController has not been initialized. in didFinishLaunchingWithOptions

Open ji3g4m6zo6 opened this issue 8 years ago • 1 comments

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
    LeftMenuViewController *leftMenu = (LeftMenuViewController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"LeftMenuViewController"];
    [SlideNavigationController sharedInstance].leftMenu = leftMenu;
    [SlideNavigationController sharedInstance].menuRevealAnimationDuration = .18;
    return YES;
}

When the app runs to : [SlideNavigationController sharedInstance].leftMenu = leftMenu;

I got the message :

SlideNavigationController has not been initialized. Either place one in your storyboard or initialize one in code

How can I fix it?

Thanks for your help.

ji3g4m6zo6 avatar Apr 16 '16 07:04 ji3g4m6zo6

As the error states, you need to embed the VC which you want to show the menu from, in a UINavigationController, and set it to the SlideNavigationController class...

orenk86 avatar Apr 18 '16 10:04 orenk86