问题:重新启动应用程序

发布于 2024-10-15 00:14:42 字数 309 浏览 6 评论 0原文

我的应用程序是一个基于视图的应用程序。一开始我显示我的徽标,延迟几秒钟后它会变成另一个视图。从那时起用户可以切换到很多不同的视图。 Sooooo..我的问题:问题是,当我重新启动我的应用程序时。 [..通过触摸图标关闭并重新打开..]应用程序本身不会在跳转到第一个视图的意义上重新启动。相反:重新启动时,用户只是返回到最后打开的视图。 所以我不知道这是为什么。 以某种方式手动告诉应用程序重新启动后返回到第一个视图是否正常?如果是这样,我该怎么做?

附言。 我不知道该怎么做..也许我的问题与我在第一个视图中使用的计时器在延迟时间后更改有关?

请问,有谁可以帮助我吗?

My App is a view-based application. At the beginning I show my logo and after a delay of a few seconds it changes into another view. from then on the user can switch to a lot of different views.
Sooooo.. My Problem: The thing is, when I restart my App. [..well closing and reopen by touching the icon..] the app itself doesnt restart in the sence of jumping to the very first view. to the contrary: at restart the user just returns to the last view that was open.
So I dont know why this is.
Is it normal to somehow manually tell the app to return to the very first view after restart? And if so, how do I have to do that?

PS.
I have so no idea what to do.. Maybe my problem has to do with the timer i used in the first view to change after a delay of time?

Please, is there anyone, who can help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故人如初 2024-10-22 00:14:42

您的问题是,从 iPhone 4 开始,返回主屏幕不会终止您的应用程序。它只是处于非活动状态,因此再次打开它会重新激活它。在大多数情况下,这是一件好事。如果它不适用于您的应用,您可以将 UIApplicationExitsOnSuspend 键添加到您的 Info.plist 中,并将值设置为 YES。

(正如我所说,只有在确实有助于可用性的情况下才应该这样做。如果只是为了再次显示启动画面,大多数用户甚至可能是苹果公司都会对此不屑一顾。)

Your problem is that, as of iPhone 4, returning to the home screen does not terminate your app. It's just made inactive, so opening it again reactivates it. In most cases, this is a good thing. If it doesn't work for your app, you can add the UIApplicationExitsOnSuspend key to your Info.plist with a value of YES.

(As I said, you should only do this if it really helps usability. If it's just about getting your splash screen shown again, most users and possibly Apple will frown upon it.)

年华零落成诗 2024-10-22 00:14:42

iOS 4.0 及更高版本具有快速启动功能,允许应用程序从重新启动时的位置重新启动。有几种方法可以解决这个问题:

1.)您的应用程序代理收到有关正在进入后台并恢复的信息。 - (void)applicationDidBecomeActive:(UIApplication *)application- (void)applicationDidEnterBackground:(UIApplication *)application 是此处的相关函数。查看文档
2.) 您还可以通过在 Info.plist 中包含 UIApplicationExitsOnSuspend 来完全禁用后台、非活动状态,正如 Chuck 已经指出的那样。

总的来说,您应该检查应用程序状态 Apple 端的文档。

iOS 4.0 and greater have a fast-start thing that allows apps to restart back from where they were upon restarting. There are several ways to deal with this:

1.) your App Delegate receives info about being but into the background and resumed. - (void)applicationDidBecomeActive:(UIApplication *)application and - (void)applicationDidEnterBackground:(UIApplication *)application are the relevant functions here. Check the docs.
2.) You can also disable the background, inactive state completely by including UIApplicationExitsOnSuspend in you Info.plist as Chuck already pointed out.

Overall, you should check the application state docs on Apple's Side.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文