Search code examples
iosobjective-ccocoa-touchios4iphone-sdk-3.0

iPhone: Is it possible to close the app rather than run in background when user clicks Home Button?


I have an app which crashes everytime when I resume it.

I want that when user clicks Home button, the app should close rather than go in background mode.

Is that possible? If yes, please let me know.

If not, what could be the workaround so that my app does not crash when I resume it?

Thanks!


Solution

  • In the plist, set YES to Application does not run in background key.

    When ur application is in background, due to memory insufficient, the views (and the objects released in viewDidUnload) might be released. Again when reopen the application, make sure all the required objects are re-initialized.