iPhone - 运行应用程序的多个实例?

时间:2021-08-17 23:01:06

When i start my app for the first time after installing it and exit before the splash screen disappears, from then on launching from the multitasking menu it comes up with a black screen. If I click on it from the home screen it loads fine but every time I try from the multitasking menu it is a black screen until I terminate it. If I add the UIApplcationExitOnSuspend property to the properties list the black screen continually appears until i restart the device. Any help is appreciated.

当我在安装它之后第一次启动我的应用程序并在启动屏幕消失之前退出时,从多任务处理菜单启动时它会出现黑屏。如果我从主屏幕点击它,它加载正常,但每次我尝试从多任务菜单,它是一个黑屏,直到我终止它。如果我将UIApplcationExitOnSuspend属性添加到属性列表中,则黑屏会不断出现,直到我重新启动设备。任何帮助表示赞赏。

Thanks Sj

谢谢Sj

1 个解决方案

#1


0  

A couple things:

几件事:

  1. You probably don't want to suspend your app prior to the splash screen disappearing. applicationDidFinishLaunching is running code (you know, like adding a window to the app) while the splash screen is showing. If you suspend it early, it doesn't have a chance. This may not be the case after the first time install but if I were you, I'd give it the time it needs to do initial install instead of interrupting it.
  2. 您可能不希望在启动屏幕消失之前暂停您的应用程序。 applicationDidFinishLaunching正在运行代码(你知道,比如在应用程序中添加一个窗口),同时显示启动画面。如果你提前暂停它,它就没有机会。在第一次安装后可能不是这种情况,但如果我是你,我会给它时间,它需要进行初始安装而不是打断它。
  3. Another less likely scenario: Are you doing this while the debug is still running? I've only had an issue similar to this (black screen after suspend) if I leave debug running and then suspend the app to the background. As soon as you bring it back out of the background, you get a black screen, so in that case it's a bug. If you hit the stop sign button in XCode to kill the app, it worked fine after that.. but you have to kill it before suspending it.
  4. 另一个不太可能的情况:你在调试仍然在运行时这样做吗?如果我让调试继续运行然后暂停应用程序到后台,我只会遇到与此类似的问题(暂停后黑屏)。一旦你把它带回背景,你会得到一个黑屏,所以在这种情况下,这是一个错误。如果你点击XCode中的停止标志按钮来杀死应用程序,那之后就可以了。但你必须在暂停之前将其杀掉。

My guess is your likely cause is #1. Give the app more time to do the initial load. After that, it should be fine. For whatever reason, the first time installing/loading is always the slowest.

我的猜测是你可能的原因是#1。为应用程序提供更多时间来执行初始加载。在那之后,它应该没问题。无论出于何种原因,第一次安装/加载始终是最慢的。

#1


0  

A couple things:

几件事:

  1. You probably don't want to suspend your app prior to the splash screen disappearing. applicationDidFinishLaunching is running code (you know, like adding a window to the app) while the splash screen is showing. If you suspend it early, it doesn't have a chance. This may not be the case after the first time install but if I were you, I'd give it the time it needs to do initial install instead of interrupting it.
  2. 您可能不希望在启动屏幕消失之前暂停您的应用程序。 applicationDidFinishLaunching正在运行代码(你知道,比如在应用程序中添加一个窗口),同时显示启动画面。如果你提前暂停它,它就没有机会。在第一次安装后可能不是这种情况,但如果我是你,我会给它时间,它需要进行初始安装而不是打断它。
  3. Another less likely scenario: Are you doing this while the debug is still running? I've only had an issue similar to this (black screen after suspend) if I leave debug running and then suspend the app to the background. As soon as you bring it back out of the background, you get a black screen, so in that case it's a bug. If you hit the stop sign button in XCode to kill the app, it worked fine after that.. but you have to kill it before suspending it.
  4. 另一个不太可能的情况:你在调试仍然在运行时这样做吗?如果我让调试继续运行然后暂停应用程序到后台,我只会遇到与此类似的问题(暂停后黑屏)。一旦你把它带回背景,你会得到一个黑屏,所以在这种情况下,这是一个错误。如果你点击XCode中的停止标志按钮来杀死应用程序,那之后就可以了。但你必须在暂停之前将其杀掉。

My guess is your likely cause is #1. Give the app more time to do the initial load. After that, it should be fine. For whatever reason, the first time installing/loading is always the slowest.

我的猜测是你可能的原因是#1。为应用程序提供更多时间来执行初始加载。在那之后,它应该没问题。无论出于何种原因,第一次安装/加载始终是最慢的。