Instance Method

applicationWillEnterForeground:

Tells the delegate that the app is about to enter the foreground.

Declaration

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

Parameters

application

Your singleton app object.

Discussion

In iOS 4.0 and later, this method is called as part of the transition from the background to the active state. You can use this method to undo many of the changes you made to your app upon entering the background. The call to this method is invariably followed by a call to the applicationDidBecomeActive: method, which then moves the app from the inactive to the active state.

The app also posts a UIApplicationWillEnterForegroundNotification notification shortly before calling this method to give interested objects a chance to respond to the transition.

See Also

Responding to App Life-Cycle Events

- applicationDidBecomeActive:

Tells the delegate that the app has become active.

- applicationWillResignActive:

Tells the delegate that the app is about to become inactive.

- applicationDidEnterBackground:

Tells the delegate that the app is now in the background.

- applicationWillTerminate:

Tells the delegate when the app is about to terminate.

UIApplicationDidBecomeActiveNotification

Posted when the app becomes active.

UIApplicationDidEnterBackgroundNotification

Posted when the app enters the background.

UIApplicationWillEnterForegroundNotification

Posted shortly before an app leaves the background state on its way to becoming the active app.

UIApplicationWillResignActiveNotification

Posted when the app is no longer active and loses focus.

UIApplicationWillTerminateNotification

Posted when the app is about to terminate.