views:

162

answers:

1

I'm testing an iPhone app in both the simulator (XCode 3.2.3, iPhone SDK 4.0.1) and on the device (iPhone 4 and iOS 4.0.1). The simulator exhibits the expected "fast app switching" behavior while the device does not.

Simulator:

  • click home button while app is running => go back to home screen
  • click the app icon => app resumes where it left-off (app does not restart)

Device

  • click home button while app is running => go back to home screen
  • click the app icon => app restarts (does not resume from the user quit)

Why is this happening?

+3  A: 

Maybe your phone is low on memory.

Pumbaa80
looks like this might be the case. my app does load a non-trivial amount of resources into memory (and doesn't release them when the app "moves into the background"). anyways I tested moving the stop-watch (Apple's clock app) into the background and bringing it back and the app did not restart (in fact it kept running in the background).
MrDatabase
If this is the case... MrDatabase, could you tell us what is the output of your console? Is there anything like Memory Warning level 3?
unknownthreat
You may also want to try this: http://stackoverflow.com/questions/582401/iphone-helpfulness-of-didreceivememorywarning/582648#582648
Pumbaa80
Turns out it was because I was making OpenGL calls after the app entered the background. Memory was not the issue.
MrDatabase