Pause and Resume iPhone app

Hi,

How does iPhone deal with pause and resume the application?

Thanks.

Mac OS X (10.5.2)

Posted on Jul 24, 2008 3:17 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 24, 2008 4:49 PM

Apps don't really pause when you press the home button. They exit. You have to save your state when you exit, and resume it when it is launched again. That's pretty much app-dependent.

The only time they actually pause is when there is an incoming phone call. When a phone call comes in, your application is sent applicationWillResignActive, and then if the user answers the call you get applicationWillTerminate, and it exits, if they ignore it, then you get applicationDidBecomeActive. Mokeyball's behavior here is to pause the game. Checkword (my app) just ignores the events.

See the "Core Application Architecture" of the "iPhone OS Programming guide"
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone OSProgrammingGuide/ApplicationEnvironment/chapter6_section_2.html#//appleref/doc/uid/TP40007072-CH7-SW2
5 replies
Question marked as Top-ranking reply

Jul 24, 2008 4:49 PM in response to mzichao

Apps don't really pause when you press the home button. They exit. You have to save your state when you exit, and resume it when it is launched again. That's pretty much app-dependent.

The only time they actually pause is when there is an incoming phone call. When a phone call comes in, your application is sent applicationWillResignActive, and then if the user answers the call you get applicationWillTerminate, and it exits, if they ignore it, then you get applicationDidBecomeActive. Mokeyball's behavior here is to pause the game. Checkword (my app) just ignores the events.

See the "Core Application Architecture" of the "iPhone OS Programming guide"
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone OSProgrammingGuide/ApplicationEnvironment/chapter6_section_2.html#//appleref/doc/uid/TP40007072-CH7-SW2

Jul 24, 2008 5:12 PM in response to mzichao

I downloaded many applications from App Store. They all exit after user accepts an incoming call and restarts the app after the call is ended (e.g. Payal and AIM), not resume at the screen where the incoming call came in. Even Contact app does that as well. My app does exactly that. Since they all passed Apple testing and are available on App Store for public download, do I need to worry about the submission over this?

Also, I read that iPhone only allows one application to be run at any given time. Does this correspond to this behavior?

Thanks.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Pause and Resume iPhone app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.