1 - (void)removeVC:(UIViewController *)urViewControllerClass 2 { 3 NSArray* tempVCA = [self.navigationController viewControllers]; 4 for(UIViewController *tempVC in tempVCA) 5 { 6 if([tempVC isKindOfClass:[urViewControllerClass class]]) 7 { 8 [tempVC removeFromParentViewController]; 9 } 10 } 11 }