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

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

问题描述

我正在尝试让我的iPhone应用程序在按下注销"按钮时以编程方式重新启动.

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

有人可以分享代码示例吗?我读过可以通过修改main.m文件来实现,但是我找不到与此相关的任何代码.

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

任何帮助将不胜感激.

推荐答案

首先,尽管可以强行杀死您的应用程序,但这是Apple不允许的,将被拒绝.即使没有被拒绝,一旦它被杀死,也无法重新启动您的应用程序.如Jason Coco所述,您只需要找到某种方法即可通过代码重置应用.可能还有更多工作要做,但是值得苹果公司予以拒绝.

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天全站免登陆