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?

MrDatabase
  • 43,245
  • 41
  • 111
  • 153

1 Answers1

3

Maybe your phone is low on memory.

user123444555621
  • 148,182
  • 27
  • 114
  • 126
  • 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 Jul 24 '10 at 05:40
  • 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? – Karl Jul 26 '10 at 15:14
  • 1
    You may also want to try this: http://stackoverflow.com/questions/582401/iphone-helpfulness-of-didreceivememorywarning/582648#582648 – user123444555621 Jul 26 '10 at 15:57
  • Turns out it was because I was making OpenGL calls after the app entered the background. Memory was not the issue. – MrDatabase Jul 27 '10 at 01:26