在iOS 13设备上运行应用程序时,Xcode 11.3引发异常,但在模拟器上不运行 [英] Xcode 11.3 throws exception when running app on iOS 13 device, but not on simulator

查看:56
本文介绍了在iOS 13设备上运行应用程序时,Xcode 11.3引发异常,但在模拟器上不运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到Xcode 11.3后,我们的应用在iOS 13.3设备上运行时会引发异常.异常不会每次都在同一位置发生,并且日志表明该异常来自com.apple.CoreAnalytics(请参阅下文).该异常仅抛出一次.而且,当我在模拟器上运行应用程序时,不会引发异常.预先感谢您的想法和想法!

After upgrading to Xcode 11.3, our app throws an exception when running on an iOS 13.3 device. The exception does not occur at the same place every time, and the log indicates the exception is coming from com.apple.CoreAnalytics (see below). The exception is only thrown once. And, the exception is NOT thrown when I run the app on the simulator. Thanks in advance for your thoughts and ideas!

推荐答案

有时,Apple的框架使用异常作为内部消息传递技术.他们可能不应该这样做,但是框架包含许多旧代码,这些代码并不总是遵循最佳实践.这样做没有什么害处,因为引发异常的框架也会捕获该异常,这就是为什么如果应用程序仅在没有调试器的情况下运行就可以正常运行的原因.但是,如果您从Xcode运行并设置了异常断点,则将在引发之后但在捕获之前暂停.看起来就是这样.因此,只需删除该断点即可.

Sometimes Apple's frameworks use exceptions as an internal messaging technique. They probably shouldn't do that, but the frameworks contain a lot of old code that doesn't always follow best practices. There is no harm done, because the framework, having thrown the exception, also catches it, which is why you run fine if the app just runs without the debugger. But if you run from Xcode and you have set an Exception Breakpoint, you will pause after the throw but before the catch. It looks like that's what's happening. So just remove that breakpoint.

这篇关于在iOS 13设备上运行应用程序时,Xcode 11.3引发异常,但在模拟器上不运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆