开发者

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

开发者 https://www.devze.com 2023-03-21 09:08 出处:网络
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.

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, plea开发者_JS百科se let me know.

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

Thanks!


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.


To opt out of background execution, see this thread... But ideally what you should do is fix the crash and let app user enjoy iOS background feature..

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

Never think of work arounds when you can handle it straight..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号