獲取程序中無需釋放的ViewController

AppDelegate.happ

@property (strong, nonatomic) UIViewController *viewController;atom

 

在須要用的地方spa

#define appDelegate ((AppDelegate *)[UIApplication sharedApplication].delegate)it

 if (!appDelegate.viewController) {io

        appDelegate.viewController =[ [UIViewController alloc]init]class

    }im

    [self presentViewController:appDelegate.viewController animated:YES completion:^{animate

    }];view

相關文章
相關標籤/搜索