Sunday, 17 August 2014

Popping to a specific viewcontroller in a navigation stack.

NSArray *arrayViewControllers = [self.navigationController viewControllers];
    
    
    for (UIViewController *controller in arrayViewControllers)
    {
        
        //Do not forget to import HomeViewController.h
        if ([controller isKindOfClass:[HomeViewController class]])
        {
            
            [self.navigationController popToViewController:controller
                                                  animated:YES];
            break;
        }

    }

No comments:

Post a Comment