GUI 被 uibackgroundmodes= voip, audio 困住

发布于 2024-09-30 13:52:04 字数 223 浏览 4 评论 0原文

我有基于选项卡栏的应用程序。当我放入 plist UIBackgroundModes 时(我的应用程序应该支持 voip),GUI 不会加载。它在启动屏幕上很糟糕,并且不会加载第一个选项卡视图。当我从 info.plist 中删除 UIBackgroundModes 属性时,它工作正常。更重要的是,当它卡住时按主页按钮没有任何作用。有人遇到过类似的问题吗? (模拟器上存在问题)

谢谢,

Nava

I have tabbar-based application. When I put in my plist UIBackgroundModes (my application is supposed to support voip), the GUI doesn't load. It sucks on Splash screen and doesn't load the first tab view. When i remove the UIBackgroundModes property from info.plist, it works fine. More than that, pressing the home button when it stuck does nothing. Did somebody encountered a similar problem? (The problem exists on simulator)

Thanks,

Nava

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

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

发布评论

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

评论(4

西瑶 2024-10-07 13:52:04

看起来,问题只发生在模拟器上,它可以在设备上运行......所以解决方案(临时的)不是将 UIBackgroundModes 放入模拟器版本的 info.plist 中。

It appears, that the problem happens on Simulator only, it works on the device... So the solution (temporary one) is not to put UIBackgroundModes into info.plist for simulator version.

静若繁花 2024-10-07 13:52:04

您负责在进入和退出后台模式时加载/卸载界面。当退出后台时,您还需要相应地更新界面。

iOS 通过在将应用程序置于后台之前截取屏幕截图并在将应用程序置于前台时显示它(有点像启动应用程序时的 Default.png)以及一些 UIImage 缓存来提供一些帮助。

可能值得分享一些代码。

You are responsible for loading/unloading the interface when going in and out of the background mode. You'll also need to update the interface accordingly when coming out of background.

iOS helps a bit by taking a screenshot before putting the app in background and displaying it when getting the app to foreground (a bit like Default.png when starting the app) and also some UIImage caching.

It might be worth sharing some code.

玩套路吗 2024-10-07 13:52:04

支持后台状态转换
支持后台状态转换是 iOS 4 及更高版本中应用程序基本架构的一部分。尽管从技术上讲,要支持此功能,您唯一要做的就是链接到 iOS 4 及更高版本,但正确支持它需要一些额外的工作。具体来说,您的应用程序委托应实现以下方法并在每个方法中实现适当的行为:

  • 应用程序:didFinishLaunchingWithOptions:
  • applicationDidBecomeActive:
  • applicationWillResignActive:
  • applicationDidEnterBackground:
  • applicationWillEnterForeground:
  • 应用程序将终止:

成为一个负责任的、具有多任务意识的应用程序
与前台应用程序相比,在后台运行的应用程序的功能受到更多限制。即使您的应用程序不在后台运行,您在实现应用程序时也应该遵循某些准则。

  • 请勿从代码中进行任何 OpenGL ES 调用。您不得创建 EAGLContext 对象或发出任何类型的 OpenGL ES 绘图命令。使用这些调用将导致您的应用程序立即终止。
  • [...]

iOS 应用程序编程指南< /a>

Supporting Background State Transitions
Supporting the background state transition is part of the fundamental architecture for applications in iOS 4 and later. Although technically the only thing you have to do to support this capability is link against iOS 4 and later, properly supporting it requires some additional work. Specifically, your application delegate should implement the following methods and implement appropriate behaviors in each of them:

  • application:didFinishLaunchingWithOptions:
  • applicationDidBecomeActive:
  • applicationWillResignActive:
  • applicationDidEnterBackground:
  • applicationWillEnterForeground:
  • applicationWillTerminate:

Being a Responsible, Multitasking-Aware Application
Applications that run in the background are more limited in what they can do than a foreground application. And even if your application does not run in the background, there are are certain guidelines you should follow when implementing your application.

  • Do not make any OpenGL ES calls from your code. You must not create an EAGLContext object or issue any OpenGL ES drawing commands of any kind. Using these calls will cause your application to be terminated immediately.
  • [...]

iOS Application Programming Guide

如果没有 2024-10-07 13:52:04

我也看到这个错误。这很烦人。就好像应用程序卡在模拟器中并且无法继续运行。当这种情况发生时,我知道如何“解开”它。

在模拟器中,我只需进入菜单“硬件”>“锁定手机,然后再次解锁。现在我停止调试器并再次启动应用程序。这似乎让它复活了。

幸运的是,这个错误不会发生在真机上,只会发生在模拟器中。

I see this bug as well. It's very annoying. It's as if the app is stuck in the simulator and won't keep going. When this happens, I know how to "unstick" it.

In the simulator I just go to menu Hardware > Lock and then unlock the phone again. Now I stop the debugger and start the app again. This seems to kick it back to life.

Fortunately this bug doesn't happen on a real phone, only in the simulator.

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