title: Which function is called when iPhone app is terminated?
body: <p>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 time when an users force the app running on background to be terminated from home screen. I was assuming that </p>
  
  <p><code>(void)applicationWillTerminate:(UIApplication *)application</code></p>
  
  <p>would be called, but it turned out it was not called even after terminating the app on background.
  What I basically want to do is to call a method that I created just before the app is completely terminated, so need to know which function is called at the end of the app.</p>
  
  <p>Thank you.</p>