获取程序中无需释放的ViewController
AppDelegate.h
@property (strong, nonatomic) UIViewController *viewController;
在需要用的地方
#define appDelegate ((AppDelegate *)[UIApplication sharedApplication].delegate)
if (!appDelegate.viewController) {
appDelegate.viewController =[ [UIViewController alloc]init]
}
[self presentViewController:appDelegate.viewController animated:YES completion:^{
}];