Unbalanced calls to begin/end appearance transitions for

后端 未结 22 1855
长情又很酷
长情又很酷 2020-11-28 19:23

I read SO about another user encountering similar error, but this error is in different case.

I received this message when I added a View Controller initially:

22条回答
  •  有刺的猬
    2020-11-28 20:03

    Actually you need to wait till the push animation ends. So you can delegate UINavigationController and prevent pushing till the animation ends.

    - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
        waitNavigation = NO;
    }
    
    
    -(void)showGScreen:(id)gvc{
    
        if (!waitNavigation) {
            waitNavigation = YES;
            [_nav popToRootViewControllerAnimated:NO];
            [_nav pushViewController:gvc animated:YES];
        }
    }
    

提交回复
热议问题