-
方法
-(UIViewController *)viewController
{
for (UIView *next = [self superview]; next; next = next.superview) {
UIResponder *nextResponser = [next nextResponder];
if ([nextResponser isKindOfClass:[UIViewController class]]) {
return (UIViewController *)nextResponser;
}
}
return nil;
} -
调用
SecondViewController *Second = [[SecondViewController alloc] init];
UIViewController *controller = [self viewController];//调用
[controller.navigationController pushViewController: Second animated:YES];
网友评论