获取navigationController中的控制器
@implementation UIViewController (UIViewControllerExt) - (void)popViewController:(NSString *)controllerStr { for (UIViewController *vc in self.navigationController.viewControllers) { if ([vc isKindOfClass:[NSClassFromString(controllerStr) class]]) { [self.navigationController popToViewController:vc animated:YES]; } } }