简体   繁体   English

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

[英]iPhone - Multiple instances of an application running?

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. 如果我将UIApplcationExitOnSuspend属性添加到属性列表,则黑屏会持续出现,直到我重新启动设备。 Any help is appreciated. 任何帮助表示赞赏。

Thanks Sj 谢谢Sj

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. 在初始屏幕显示时, applicationDidFinishLaunching正在运行代码(您知道,就像在应用程序中添加了一个窗口一样)。 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. 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. 如果您在XCode中按了停止标志按钮以终止该应用程序,则此后它可以正常工作..但是您必须先终止它,然后再挂起它。

My guess is your likely cause is #1. 我的猜测是您可能的原因是#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. 无论出于何种原因,首次安装/加载总是最慢的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM