iOS 在视图控制器里面判断 应用程序的前台

来源:互联网 发布:淘宝外围活动怎么参加 编辑:程序博客网 时间:2024/06/06 06:51
/增加监听[[NSNotificationCenter defaultCenter] addObserver:self                                         selector:@selector(appHasGoneInForeground:)                                      name:UIApplicationWillEnterForegroundNotification                                           object:nil];  //别忘了删除监听[[NSNotificationCenter defaultCenter] removeObserver:self];   
UIApplicationDidEnterBackgroundNotification  //进入后台UIApplicationWillEnterForegroundNotification //回到程序
0 0
原创粉丝点击