1.获取当前控制器viewController
- (UIViewController*)viewController {
for(UIView* next = [selfsuperview]; next; next = next.superview) {
UIResponder*nextResponder = [nextnextResponder];
if([nextResponderisKindOfClass:[UIViewControllerclass]]) {
return(UIViewController*)nextResponder;
}
}
returnnil;
}
2.appdelegate跳转控制器
XPFMainViewController*mian=(XPFMainViewController*)[UIApplicationsharedApplication].keyWindow.rootViewController;
//mian.selectedIndex=0;
UINavigationController*nav=mian.viewControllers[mian.selectedIndex];
FullTimeViewController*local=[FullTimeViewControllernew];
local.hidesBottomBarWhenPushed=YES;
[navpushViewController:localanimated:YES];