views:

143

answers:

2

Hi guys!

I have a hard time to understand my iPhone Application strange behavior in iOS4.

  1. Exit my app with Home button -> applicationWillResignActive , didEnterBackground is called,
  2. Open my app -> applicationDidBecomeActive , didEnterForground is called. Everything is normal here.
  3. Exit my app with Home button -> applicationWillResignActive , didEnterBackground is called,
  4. Double tap Home button, exit my app with "minus" button.
  5. Open my app -> applicationDidBecomeActive , didEnterForground is called.
  6. Exit my app with Home button -> applicationWillTerminate is called.
  7. 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?

+2  A: 

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.

Claus Broch
wasnt handle my memory correctly ... ty for video
f0rz
+2  A: 

Take a look at these flow charts: link text

+1 for the link
TechZen