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