首页 > 其他 > 详细

怎么在某个控制器中判断程序是否在前台或后台

时间:2016-04-20 13:36:55      阅读:172      评论:0      收藏:0      [点我收藏+]
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(appHasGoneInForeground:)
                                      name:UIApplicationWillEnterForegroundNotification
                                           object:nil];  
//别忘了删除监听
[[NSNotificationCenter defaultCenter] removeObserver:self];   


UIApplicationDidEnterBackgroundNotification  //进入后台
UIApplicationWillEnterForegroundNotification //回到程序

怎么在某个控制器中判断程序是否在前台或后台

原文:http://www.cnblogs.com/pangbin/p/5411959.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!