I\'m working on a project in Xcode version 4.2.1 and in iOS 5.0. I\'m wondering which function will be called when you completely terminate an application, which means even
The documentation here spells out the behavior for this case.
In short, you'll only receive the applicationWillTerminate:
message if the app is running (either in the foreground or background) when it's terminated. So, unless your app is running in the foreground or in one of the long-running background modes (e.g. VoIP, Audio, or a long-running task indicated by beginBackgroundTaskWithExpirationHandler
) it will transition from the background
state to the suspended
state fairly quickly. In this case, you'll never receive the applicationWillTerminate:
message.