I found this method in a delegate file and inserted some code. The code never gets executed, even when the home bu开发者_JAVA技巧tton is pressed. When or how does this function get called?
You should use applicationDidEnterBackground
method if your app and OS support multitasking.
From applicationWillTerminate
docs:
For applications that support background execution, this method is generally not called when the user quits the application because the application simply moves to the background in that case. However, this method may be called in situations where the application is running in the background (not suspended) and the system needs to terminate it for some reason.
精彩评论