【问题标题】:When to refresh a view when iOS app is being recalled from inactive/suspended当 iOS 应用程序从非活动/挂起状态被召回时,何时刷新视图
【发布时间】:2012-03-09 14:01:52
【问题描述】:

我的应用在视图中包含时间敏感信息,当用户从非活动/暂停状态调用应用时,这些信息需要更新。下面的两个应用程序委托方法中的哪一个应该处理这个问题?

这里:

- (void)applicationDidBecomeActive:(UIApplication *)application{

 //Check to see if we need to refresh a view
 if([self needToRefreshView])
   [viewcontroller1 refreshView];

}

这里:

- (void)applicationWillEnterForeground:(UIApplication *)application{


   //Check to see if we need to refresh a view
   if([self needToRefreshView])
   [viewcontroller1 refreshView];


 }

一种方法比另一种更适合这个吗?如果是,为什么?

谢谢

【问题讨论】:

标签: ios5 uiapplicationdelegate


【解决方案1】:

这些应该都可以正常工作,我会考虑在其中实现您的代码的唯一其他方法是viewWillAppear

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-20
    相关资源
    最近更新 更多