从后台调用我的应用程序后调用方法

时间:2011-10-19 13:19:23

标签: iphone objective-c

当我从背景中再次使用我的应用程序时,我需要执行一些代码...我需要刷新我的观点...我能做到吗? 感谢

1 个答案:

答案 0 :(得分:1)

使用App委托方法 -

    - (void)applicationDidEnterBackground:(UIApplication *)application
{
    /*
     Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
     If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
     */
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    /*
     Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
     */
}