Xcode泄漏工具卡在MapkKit/CllocationManager Ios8上



我在使用Xcode工具查找应用程序中的漏洞时遇到了一个奇怪的问题。除了带有mapView的屏幕外,我的所有屏幕都可以使用该工具(例如,我有一些注册屏幕,然后用户进入mapView屏幕,以防登录到mapView屏幕的用户打开)。我认为这个问题在某种程度上与CllocationManager有关但我不确定,因为应用程序只是在使用泄漏工具时卡住了。我从我的设备收到以下日志:

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"由于太多未处理的消息而丢弃事件0的消息"是什么意思
是的,我的位置管理器在主线程上运行(它在调试模式下运行得很好,没有它)。

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

有没有人遇到过类似的问题,或者有什么想法我可以试试
非常感谢。

最后我发现了问题。这个问题很愚蠢,我相信没有多少人会有这种问题,但我会发布我愚蠢的错误。当我开发应用程序时,我在那里包含了很多日志(服务器的一些响应),随着时间的推移,我忘记了删除它们(当然在发布之前我会删除)。当应用程序使用工具运行时,这就是它真正卡住的原因。我从苹果公司得到的回应是:

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

事实上,当我运行"时间分析器"时,我注意到在某些方法中运行Nslog的百分比时间相当高。。。。。。。

相关内容

  • 没有找到相关文章

最新更新