首页 > 其他 > 详细

获取程序中无需释放的ViewController

时间:2015-08-20 12:32:35      阅读:152      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!