views:

170

answers:

3

For the moment I don't want to care about multitasking. My app has a very long development trip behind it, and now it has been engineered that way that when the user hits the home button, the app gets killed. When he comes back, the app appears like he left it.

If I wanted to get this same behavior back, which methods would I have to implement in the app delegate? I assume that I would have to treat the case where my app becomes a background app just like if the home button was pressed, i.e. if applicationWillTerminate was called. That would be the simplest way, right?

A: 

Set UIApplicationExitsOnSuspend to YES in your Info.plist. Your customers will hate your app for not supporting fast app switching, though.

Ole Begemann
+6  A: 

You need to set a boolean flag in your Info.plist file called UIApplicationExitsOnSuspend to YES. When you do so, when the user hits the home button, -applicationWillTerminate will get called, as normal.

Jacob Relkin
A: 

Include the UIApplicationExitsOnSuspend key in your Info.plist. See this for more information.

Noah Witherspoon