iPhone 应用程序被杀死后无法在设备上启动 - 在模拟器上工作正常
我想更新我的应用程序,但遇到了严重的问题。当发送到后台并返回前台时,该应用程序运行良好。但是,在从多任务处理(在后台运行)中终止进程后,应用程序尝试从它离开的位置恢复并冻结,这意味着我无法再启动应用程序!!!!除了将操作系统从 4.0 更新到 4.0.1 之外,我没有对代码进行任何更改。
谁能帮我解决这个问题吗?
奇怪的是:我无法在模拟器上重现这个问题,它在那里工作得很好。
I want to put an update to my App and I'm encountering heavy issues. When sent to background and being brought back to foreground, the App works fine. However, after killing the process from multitasking (running in the background), the App tries to resume from the point where it left AND it freezes, which means, I cant start the App anymore!!!! I have made no changes to the code, except updating my OS from 4.0 to 4.0.1.
Can anyone help me out on this?
A weird thing is: I cannot reproduce this problem on the simulator, it works just fine there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我似乎找到了解决办法。苹果在更新中指出:“在调试启用多任务的应用程序时,当应用程序在后台暂停时,请避免从调试器手动暂停和继续。”暂停在后台挂起的应用程序会扰乱正常的多任务处理行为,直到应用程序重新启动为止。所以我在一个用于分发的设备上测试了它,它似乎工作正常,所以你所要做的就是忽略调试器 - 看起来。祝你好运!
I seem to have found the solution. Apple states in the updates: 'When debugging your multitasking enabled app, avoid manually pausing and continuing from the debugger when the application is suspended in the background. Pausing an application that is suspended in the background disrupts proper multitasking behavior until the application is relaunched.' So I tested it on a device for distribution and it seems to work fine, so all you have to do is ignore the debugger - it seems. Best of luck!
我的应用程序在调试模式下运行良好(我建议不要使用分发模式,因为配置文件、iTunes 同步会带来很多麻烦……而且您也无法实时看到控制台消息)。
终止应用程序并重新启动后无法执行任何操作的原因很可能是因为您直接从 XCode (Command + Enter) 运行它并且应用程序仍在“运行”。只需单击红色按钮即可停止调试,然后您可以正常从 SpringBoard 重新启动应用程序。或者只需 Command + Enter 即可再次重建它。
My app works fine for me in Debug mode (I'd advice against working with Distribution mode cause of all the hassle of provisioning profile, iTunes sync... and also you can't see the console message in real time).
The reason you can't do anything after killing the app and relaunching it is most likely because you run it directly from XCode (Command + Enter) and the app is still "running". Just click to the Red button to stop the debugging, then you can relaunch the app from the SpringBoard normally. Or just Command + Enter to rebuild it again.