码迷,mamicode.com
首页 > 其他好文 > 详细

获取程序中无需释放的ViewController

时间:2015-08-20 12:35:36      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:

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:^{

    }];

获取程序中无需释放的ViewController

标签:

原文地址:http://www.cnblogs.com/joesen/p/4744376.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!