【问题标题】:Xcode leak tool stuck on MapkKit/CllocationManager Ios8Xcode 泄漏工具卡在 MapkKit/CllocationManager Ios8
【发布时间】:2014-10-29 21:06:56
【问题描述】:

我在使用 Xcode 工具试图在我的应用程序中查找泄漏时遇到了奇怪的问题。 除了带有 mapView 的屏幕外,我的所有屏幕都可以正常使用该工具(例如,我有一些注册屏幕,然后用户继续进入 MapView 屏幕,以防用户登录到 Mapview 屏幕打开)。我认为问题与 CllocationmManager 有关 但我不确定,因为应用程序在使用泄漏工具时卡住了。 我从我的设备收到以下日志:

timed[53] <Notice>: (Note ) CoreTime: Received time 10/21/2014 15:54:04±0.00 from "GPS" 
timed[53] <Notice>: (Note ) CoreTime: Want active time in 3332.92min. Need active time in 
8332.92min. Remaining retry interval: 0.000000min.
<Notice>: (Note ) CoreTime: Received time 10/21/2014 15:54:09±0.00 from "GPS"
<Notice>: (Note ) CoreTime: Want active time in 3332.82min. Need active time in 8332.82min.        
CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 0
CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 1
CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 2
<Error>: throttleCallBack(): Clearing throttle timer on context ID 3
timed[53] <Notice>: (Note ) CoreTime: Received time 10/21/2014 15:54:14±0.00 from "GPS"
 timed[53] <Notice>: (Note ) CoreTime: Want active time in 3332.75min. Need active time in     
 CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 0
 CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 1

CoreLocation: Discarding message for event 0 because of too many unprocessed messages

根据该链接,我认为最后一行是最重要的:iOS5 What does “Discarding message for event 0 because of too many unprocessed messages” mean?
是的,我的 locationManager 在主线程上运行(它在调试模式下工作得很好,没有它)。

我也在模拟器中尝试(我认为它也卡住了一些不同的原因,但我需要主要在设备上测试它,因为我的应用程序严重依赖于用户位置)。
我设置了所有可能的配置以在我的方案中进行调试。
我尝试重新启动设备。
我在 iphone 5s 和 4 上试过。 (我使用 Xcode6 Ios8 )。

有没有人有类似的问题或想法我可以尝试什么?
非常感谢。

【问题讨论】:

    标签: ios xcode memory-leaks


    【解决方案1】:

    最后我发现了问题。好吧,这个问题非常愚蠢,我相信没有多少人会遇到这种问题,但我会发布我的愚蠢错误。 当我开发应用程序时,我在那里包含了很多日志(来自服务器的一些响应),随着时间的流逝,我忘记了删除它们(当然在发布之前我会)。 这实际上是在使用工具运行应用程序时卡住了应用程序。 我从苹果支持收到的回复:

    由于 NSLog 也在主线程上写入,它同时阻塞了地图显示和位置管理器。 要记住的一件事是,虽然 NSLog 通常用于打印我们的调试信息,但这并不是真正的工作。 如果您查看 Foundation Framework Reference 文档,NSLog 被描述为:将错误消息记录到 Apple 系统日志工具。 因此它是一个非常重量级的调用,对应用的性能影响很大。

    确实,当我运行“时间分析器”时,我注意到在某些方法中运行 Nslog 的百分比时间相当高......

    【讨论】:

      猜你喜欢
      • 2016-04-02
      • 1970-01-01
      • 2011-07-15
      • 2011-05-26
      • 2011-10-29
      • 1970-01-01
      • 2013-05-10
      • 2011-09-17
      • 1970-01-01
      相关资源
      最近更新 更多