home键退出应用后,再点击应用会调用哪个系统方法? 我给我的app设置了设置束,home键退出,然后到设置里面更改了我的app的一些首选项,结果再点击进入app的时候却没有更改显示的值。app中现有的方法都没有被调用。求大神指教,在这种情况下,会调用哪个系统方法啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 UiApplacationDelegate 中applicationDidBecomeActive 从新读取你的配置 我也找到了一种方法:在viewDidLoad中添加以下代码:UIApplication *app = [UIApplication sharedApplication];[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:app];然后实现applicationWillEnterForeground:方法- (void) applicationWillEnterForeground: (NSNotification *) notification { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults synchronize]; // refreshInfo方法是自己编写的,用来重新获取用户的设置信息 [self refreshInfo];} iphone开发中协议的使用 IOS button 图片变暗 iOS应用,第一次没有关闭应用,第二次打开闪退 猎隼”涉密计算机上网监察取证系统简体中文绿色版病毒问题 照相机的焦距,和灯光能否用代码改变?如何? 有做过短信截获这方面的吗? IPhone 开发平台的搭建问题想问下各位高手? 学习iphone 数据绑定UITableView变全屏了,怎么不让它变成全屏 ios后端一般用什么开发 一直搞symbian,没想到转行搞ios这么难 NSString转化为UInt16的数据类型
在viewDidLoad中添加以下代码:
UIApplication *app = [UIApplication sharedApplication];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:app];
然后实现applicationWillEnterForeground:方法
- (void) applicationWillEnterForeground: (NSNotification *) notification {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults synchronize];
// refreshInfo方法是自己编写的,用来重新获取用户的设置信息
[self refreshInfo];
}