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

Crashes When Attempting to Present Side View Multiple Times #243

@spiderguy84

Description

@spiderguy84

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions