强制iphone应用程序以编程方式重新启动 [英] Force iphone app to restart programmatically

查看:154
本文介绍了强制iphone应用程序以编程方式重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我按下Logout按钮时,我试图让我的iPhone应用程序以编程方式重新启动。

I am trying to get my iPhone app to restart programmatically when the Logout button is pressed.

有没有人有代码样本要分享?我已经读过可以通过修改main.m文件但找不到与此相关的任何代码。

Has anyone got an code sample to share? I've read that it is possible by modifying the main.m file but couldn't find any code related to this.

任何帮助都将不胜感激。

Any help would be appreciated.

推荐答案

首先,尽管可以强行终止您的应用,Apple不允许这样做,但会被拒绝。即使它没有被拒绝,也无法在应用程序被杀后重新启动它。您只需找到一些通过代码重置应用程序的方法,如 Jason Coco 所述。这可能是更多的工作,但不值得Apple拒绝。

First of all, although it is possible to force kill your app, this is not allowed by Apple and will rejected. Even if it wasn't rejected, there is no way to restart your app once it's killed. You just need to find some way to reset your app through your code, as Jason Coco said. It might be more work, but it's worth it to not get rejected by Apple.

这篇关于强制iphone应用程序以编程方式重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆