开发者

How can I programmatically close all other applications from my iPhone application?

开发者 https://www.devze.com 2023-01-21 10:01 出处:网络
Is it possible to 开发者_StackOverflow社区programmatically close all running applications on the iPhone except my own from within my own application?If so, how?No. All apps run in a sandbox so that yo

Is it possible to 开发者_StackOverflow社区programmatically close all running applications on the iPhone except my own from within my own application? If so, how?


No. All apps run in a sandbox so that you can't communicate between them. And even if you technically could it would be considered bad practice.

Why do you need to close other apps? I can't think of any valid use case where that would be necessary.


An app doesn't have access to the home button on a stock device. The only other access to any other apps in the background is if they have registered a URL handler.


It's not possible and there's also no need to.

There are very conservative limits on how much processing a background app can use and if the result of low memory warnings is that there still isn't enough memory, the OS will automatically start killing things. Don't try to be clever - it's just as willing to kill you and indeed will kill you first if nothing else is running.

0

精彩评论

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

关注公众号