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];} cocos2d-x中播放音乐 UIWebView如何加载本地HTML? iphone开发者资格可开发票否? 哪位好心人给个MavericksInstaller.vmdk文件 应用中启动qq聊天 APP上线流程 又一年光棍节~又一年单身汪的我T_T! IOS UITableview遇到的问题 [求助]Xcode打印了有关libMobileGestalt的信息 iOS MQTT订阅主题时接收的消息一直为NULL 一直搞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];
}