I have a hard time to understand my iPhone Application strange behavior in iOS4.
- Exit my app with Home button ->
applicationWillResignActive,didEnterBackgroundis called, - Open my app ->
applicationDidBecomeActive,didEnterForgroundis called. Everything is normal here. - Exit my app with Home button ->
applicationWillResignActive,didEnterBackgroundis called, - Double tap Home button, exit my app with “minus” button.
- Open my app ->
applicationDidBecomeActive,didEnterForgroundis called. - Exit my app with Home button ->
applicationWillTerminateis called. - Debugger stopped.
Program exited with status value:0.
(4, 5 , 6) . What is really happening when I press minus button? Shouldn’t application terminate and next time I open application (BOOL)application:(UIApplication*)application didFinishLaunching be called?
Can anyone help me understand this?
If the application have already entered the inactive state (applicationWillResignActive+didEnterBackground) you will not get any further notifications if the application is terminated.
I would though expect your application to stop completely after step 4, but since you didn’t get the debugger terminated message (as in step 7) somehow the application didn’t terminate fully.
The WWDC 2010 Session 105 – Adopting Multitasking on iPhone OS, Part 1 Video explains the application state transitions extremely well.