位置管理器是在调度队列上创建的 [英] location manager was created on a dispatch queue

查看:71
本文介绍了位置管理器是在调度队列上创建的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这条消息是什么意思?

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

NOTICE,A location manager (0xe86bdf0) 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.

推荐答案

您必须在具有活动运行循环的线程上创建CLLocationManager,例如主线程。您不应该在后台线程上创建它。有关更多信息,请参见 CLLocationManager类参考信息:

You must create the CLLocationManager on a thread with an active run loop, such as the main thread. You should not create it on a background thread. See CLLocationManager Class Reference for more information:


(位置管理器对象的配置必须始终出现在具有活动运行循环的线程上,例如应用程序的主线程。 )

(Configuration of your location manager object must always occur on a thread with an active run loop, such as your application’s main thread.)

如果您对运行循环的确切感兴趣,请参阅运行循环以获取更多信息。

If you're interested in what exactly a run loop is, see Run Loops for further information.

这篇关于位置管理器是在调度队列上创建的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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