最近搞ios开发类似于IM的app,接到消息后,需要在任意窗口进行弹窗,背景是,主页面我使用了UITabBarController,并且具有导航栏,具体做法是,将UITabBarController作为需要跳转页面的前一级页面,
通过
UITabBarController *tabVC = (UITabBarController *)[UIApplication sharedApplication].keyWindow.rootViewController;获取到当前的主窗体;
通过
UINavigationController *pushClass = (UINavigationController *)tabVC.viewControllers[tabVC.selecte