This flowchart will clarify how the management of the multitasking works in iOS 4.0+:
(taken from here)
What you need to do is just to manage a variable set by the various messages sent to your delegate, eg applicationWillResignActive
or applicationDidEnterBackground
, in this way you can easily understand in which state is the application and behave accordingly.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…