首先 定义一个全局变量 UIViewController *_superVC;
//然后执行这个方法(拿到当前controller)
- (UIViewController *)viewController:(UIView *)view{
UIResponder *responder = view;
while ((responder = [responder nextResponder]))
if ([responder isKindOfClass: [UIViewControllerclass]])
return (UIViewController *)responder;
return nil;
}
最后,在你跳转页面的方法中
_superVC = [self viewController:self];
[_superVC.navigationController pushViewController:(UIViewController) animated:YES];
网友评论