当网络从 3G 切换到 2G 时 iPhone 应用程序冻结

发布于 2024-10-04 11:08:33 字数 604 浏览 2 评论 0原文

我找不到任何相关信息,但确实需要确定它是否不会发生,或者证明它确实发生的文档是否太难找到!

背景故事:

当我的应用程序在 3G 信号较弱的 iPhone 上运行时,因此从较弱的 3G 来回切换到较强的 2G,反之亦然,它似乎冻结了(应用程序完全冻结) 5-10 秒)。我收到过来自四面八方的报告,但我无法复制这种情况,因为我所在地区的 3G 信号太强了!

如果我紧紧地挤压 iPhone 4,那么我可以将信号调暗到足以让我收到一条警报,告诉我没有蜂窝数据网络……然后它会短暂切换到 2G。这确实会导致冻结,我将其跟踪到导致警报解除后调用应用程序委托方法“applicationDidBecomeActive”的警报,但没有像我在考虑正常挂起/恢复过程时所预期的那样“applicationWillResignActive”。

我改变了代码中的一些逻辑来处理这个问题,现在问题已经解决了。

问题:

当手机从 3G 切换到 2G 时,是否会调用任何应用程序委托方法,反之亦然?应用程序是否会像上述情况一样暂时失去其活动状态,然后重新获得它?上述问题似乎完全复制了我的用户所经历的情况,除了我收到“无蜂窝数据网络”警报这一事实,这显然改变了一些情况。他们没有收到此警报,但仍然冻结。

谢谢

I can't find any information on this but really need to know for sure if it doesn't happen, or if the documentation that proves it does happen is just too hard to find!

The background story:

When my app is running on an iPhone that has a weak 3G signal, and therefore switches backwards and forwards from a weak 3G to a strong 2G and vice-versa, it seems to freeze (the app, a complete freeze for 5-10 seconds). I have had reports of this from far and wide but it's something I can't replicate as my 3G signal is too strong in my area!

If I squeeze my iPhone 4 tightly, then I can dim the signal enough that I get an alert telling me that there is no cellular data network ... before it switches to 2G briefly. This DOES cause a freeze, and I tracked it down to the alert causing the app delegate method "applicationDidBecomeActive" to be called after the alert is dismissed, but no "applicationWillResignActive" as I had expected when thinking of the normal suspend/resume process.

I changed some of the logic in my code to deal with this, and that problem is now resolved.

The question:

Are any app delegate methods called when the phone switches from 3G to 2G and vice-versa? Does the app momentarily lose it's active state and then regain it like it does in the above situation? The problem above seems to replicate exactly what my users are experience EXCEPT from the fact that I get the "no cellular data network" alert which obviously changes things a bit. They don't get this alert, but they still get the freeze.

Thanks

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

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

发布评论

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

评论(1

够运 2024-10-11 11:08:33

您也许可以使用可达性来跟踪这一点。

您可以在此处找到它。

You might be able to track this using Reachability.

You can find it here.

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