iOS5 “由于未处理的消息太多,正在丢弃事件 0 的消息”是什么意思?意思是?

发布于 2024-12-11 10:40:32 字数 187 浏览 0 评论 0原文

我正在对我的应用程序进行一些性能测试,并注意到运行某些集成需要很长时间。 得到了一大堆

Discarding message for event 0 because of too many unprocessed messages

过了一会儿,我在 xcode 控制台中 。这究竟意味着什么?

I'm doing some performance testing of my app and noticed that it takes exceedingly long to run some integrations. After a while, I got a whole bunch of

Discarding message for event 0 because of too many unprocessed messages

in the xcode console. What does this mean precisely?

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

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

发布评论

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

评论(2

千柳 2024-12-18 10:40:32

Apple 技术支持对此是这么说的(在为开发者技术支持事件支付了 49 美元之后):

这些消息来自 Core Location 框架。出现这些消息的最可能原因是创建 CLLocationManager 的线程上没有运行运行循环。 (这意味着 CLLocationManager 不是在主线程上创建的。)被丢弃的消息是位置消息:例如,事件 0 是位置,事件 24 是授权状态更新。由于消息被丢弃,您将看不到调用适当的委托回调。您是否设置了地理围栏或其他回调,但服务速度不够快?在开始转储事件并记录此消息之前,队列限制似乎为 10。
此信息尚未公开记录。我正在与核心位置团队合作改进报告的消息,并看看是否可以更好地记录这一点。

This what Apple Technical Support says about this (after paying $49 for a Developer Tech Support Incident):

These messages are coming from Core Location framework. The most likely cause of these messages is that there isn't a run loop running on the thread on which the CLLocationManager was created. (This implies that the CLLocationManager wasn't created on the main thread.) The messages that are being discarded are location messages: event 0 is a location and event 24 is an authorization status update, for example. Because the messages being discarded, you won't see the appropriate delegate callbacks being invoked. Did you set up a geofence or some other callback and isn't servicing it quickly enough? The queue limit appears to be 10 before it starts dumping events and logging this message.
This information isn't publicly documented yet. I'm working with the Core Location team to improve the reported messages and see if this can be better documented.

只有一腔孤勇 2024-12-18 10:40:32

迈克尔是对的,原因是位置管理器只能在有运行循环的线程上运行(默认为主线程),否则将不会处理它发送的回调。当我尝试在后台线程上初始化 Zoosh SDK 时,请参阅以下警告:

注意,在主线程以外的线程上执行的调度队列上创建了位置管理器 (0x11b5c9d0)。开发人员有责任确保在分配位置管理器对象的线程上运行运行循环。特别是,不支持在任意调度队列(未附加到主队列)中创建位置管理器,这将导致无法接收回调。

天气晴朗。将初始化放入主线程会清除此警告,并且不会发生“由于未处理的消息过多而丢弃事件 0 的消息”。

Michael is right, the reason is that location manager can only run on thread which has running loop on it (main thread by default), otherwise callbacks sent by it won't be handled. Please see following warning once I tried to initialize Zoosh SDK on a background thread:

NOTICE,A location manager (0x11b5c9d0) was created on a dispatch queue executing on a thread other than the main thread. It is the developer's responsibility to ensure that there is a run loop running on the thread on which the location manager object is allocated. In particular, creating location managers in arbitrary dispatch queues (not attached to the main queue) is not supported and will result in callbacks not being received.

It's clear. And putting the initialization into main thread clears this warning and no 'Discarding message for event 0 because of too many unprocessed messages' occurs.

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