Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Crashes When Attempting to Present Side View Multiple Times #243

Open
spiderguy84 opened this issue Oct 4, 2016 · 0 comments
Open

Crashes When Attempting to Present Side View Multiple Times #243

spiderguy84 opened this issue Oct 4, 2016 · 0 comments

Comments

@spiderguy84
Copy link

I am having an issue with PKRevealController code from GitHub crashing my app. I set it up right:

 WebViewController *rightView2 = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]];
        PKRevealController *revealController = [PKRevealController revealControllerWithFrontViewController:tabBarController leftViewController:rightView2];
        revealController.delegate = self;

       window.rootViewController = revealController;



        [window makeKeyAndVisible];

And in the viewController I want to call it from I add this:

 - (void)startPresentationMode
    {
        if (![self.revealController isPresentationModeActive])
        {
            [self.revealController enterPresentationModeAnimated:YES completion:nil];
        }
        else
        {
            [self.revealController resignPresentationModeEntirely:NO animated:YES completion:nil];
        }
    }

When I click the button to start that code, it slides over and shows the view just how I want it. Clicking outside of the side view even slides it back. But, if I click the button again, I simply get a (lldb) crash in console. If I add an exception breakpoint, it shows me a line in PKRevealController:

NSAssert([self hasLeftViewController] || [self hasRightViewController], @"%@ ERROR - %s : Cannot enter presentation mode without either left or right view controller.", [self class], __PRETTY_FUNCTION__);

What is exactly the problem going on?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant