我们做一些检查后是否可以退出iOS应用程序 [英] Is it possible to quit iOS app after we do some checks
问题描述
如果应用已过时,我们不希望用户输入我们的应用。
We don't want the user enter our app if the app is out-dated.
当我们做某个日期时,是否可以退出iOS应用在应用程序启动之前检查?
Is that is possible to quit a iOS app when we do some date check BEFORE the app launch?
或者在加载主视图后可以退出应用程序?
Or it is possible to quit the application after the main view is loaded?
推荐答案
在应用发布之前:没有。操作系统调用 main
时,启动动画已在进行中。
Before the app launches: no. The launch animation is already in progress when the OS calls main
.
一段时间后(1-2秒) :是的。你可以使用其中一个
After some time (1-2 sec): yes. You can use one of
[[UIApplication sharedApplication] terminateWithSuccess];
exit(0);
abort();
assert(0);
pthread_kill(pthread_self());
这么多方法,但都不会通过AppStpre - 你不应该以编程方式关闭你的应用程序。您应该通过UIAlertView通知用户有关过期应用的信息并禁用与应用的互动。
so many ways, but neither will go through AppStpre - you're not supposed to close your app programmatically. You're supposed to notify the user via an UIAlertView about the outdated app and disable interaction with the app.
这篇关于我们做一些检查后是否可以退出iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!