ANAdvancedNavigationController icon indicating copy to clipboard operation
ANAdvancedNavigationController copied to clipboard

the popViewController could not pop the root right view controller

Open flypigz opened this issue 13 years ago • 0 comments

the popViewController method re-use the popViewControllerToViewControl, which lead to this limitation, it does not support pop all of the right view controllers....

instead, i think the popViewControllerToViewControl should re-use code of popViewController method..

  • (void)popViewController:(UIViewController *)viewController animated:(BOOL)animated { NSLog(@"%s", PRETTY_FUNCTION); if (![self.viewControllers containsObject:viewController]) { NSLog(@"viewController (%@) is not part of the viewController Hierarchy", viewController); return; }

    // this method re-use the _popViewControllersToViewController, which require at least // one left size view controller to specify the location to pop, so it does not // support poping the root right view controller

    NSInteger index = [self.viewControllers indexOfObject:viewController]-1; // why

    NSLog(@"index: %d", index); ===> if the root right viewcontroller is passed as parameter, the index is -1 here...

    if (index >= 0) { viewController = [self.viewControllers objectAtIndex:index]; [self _popViewControllersToViewController:viewController animated:animated]; } }

flypigz avatar Dec 26 '11 14:12 flypigz