Tuesday 13 August 2013

Go to particular parent class from subclass

you can find that particular UIViewController from its navigationController's viewControllers array like bellow...

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

    }