要从主屏幕而不是从我们离开的屏幕重新启动应用程序 [英] To restart the app from the home screen and not from the screen we left at

查看:90
本文介绍了要从主屏幕而不是从我们离开的屏幕重新启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在设备上播放我们的应用程序(ios 4.0及更高版本)并离开中间工作流程,然后返回时,我们返回中间工作流程。我希望它不应该从相同的左边点重放,而应该加载主屏幕(即调用我们的rootViewController的viewDidLoad时发生的事情)。

When we play our app on the device(ios 4.0 and above) and leave mid workflow, and return later, we return mid workflow. I want that it should not replay from the same left point rather the main screen should load(i.e, the same thing that happens on calling viewDidLoad of our rootViewController).

请如果有可能给出建议,如果没有,那么请发布背后的原因。

Please give suggestions if it is possible and if not then please post the reason behind that.

推荐答案

这是另一种方法,禁用后台模式并在每次进入前台时重启您的应用:将 UIApplicationExitsOnSuspend 键添加到您应用的info.plist并将其值设置为YES。

Here's an alternative approach, disable background mode and restart your app every time it enters the foreground: add UIApplicationExitsOnSuspend key to your app's info.plist and set its value to YES.


UIApplicationExitsOnSuspend

UIApplicationExitsOnSuspend

UIApplicationExitsOnSuspend(布尔 -
iOS)指定应终止应用程序
而不是移动
退出时的背景。
链接到iOS SDK
4.0或更高版本的应用程序可以包含此密钥并将其值设置为YES,以防止
自动选择后台
执行和应用程序暂停。
当此键的值为YES时,
应用程序将终止并从内存中清除
而不是移至
后台。如果此密钥不是
存在,或者设置为NO,那么
应用程序将以
平常移至后台。

UIApplicationExitsOnSuspend (Boolean - iOS) specifies that the application should be terminated rather than moved to the background when it is quit. Applications linked against iOS SDK 4.0 or later can include this key and set its value to YES to prevent being automatically opted-in to background execution and application suspension. When the value of this key is YES, the application is terminated and purged from memory instead of moved to the background. If this key is not present, or is set to NO, the application moves to the background as usual.

这iOS 4.0支持密钥,稍后支持

This key is supported in iOS 4.0 and later.

这篇关于要从主屏幕而不是从我们离开的屏幕重新启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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