简体   繁体   English

为什么不执行DispatchQueue.main.async?

[英]Why DispatchQueue.main.async is not performed?

My app has finished to respond unexpectedly. 我的应用程序已完成意外响应。 I have researched and noticed that this operator is never performed (see picture). 我已经研究并注意到此操作符从未执行过(请参见图片)。 Why? 为什么? queue is nil. 队列为零。 I use Xcode 8.1. 我使用Xcode 8.1。 In point "come here" I'm on the thread 3. So any request is not performed. 在“来到这里”这一点上,我在线程3上。因此,不执行任何请求。 在此处输入图片说明

Edit. 编辑。 Storyboard is loading at the same time. 情节提要同时加载。 iOS can't load storyboard which I created in Xcode 7.3. iOS无法加载我在Xcode 7.3中创建的情节提要。 Even it had been working for some time in Xcode 8. I don't know what happened and why it finished to work. 即使它已经在Xcode 8中工作了一段时间,我也不知道发生了什么以及为什么结束了工作。 I checked changes on git. 我检查了git的更改。 They are absent. 他们缺席。 Probably I have to recreate my storyboard on Xcode 8. 可能我必须在Xcode 8上重新创建情节提要。

Based on what you have shown, without the full context, I am guessing that the code is looping infinitely (hence increasing memory). 根据您显示的内容,如果没有完整的上下文,我猜测代码将无限循环(因此会增加内存)。 Some code from main queue is making async call infinitely, triggering this 'response' function when the call finishes. 主队列中的某些代码无限地进行异步调用,并在调用完成后触发此“响应”功能。 The responses are dispatched to main but they are not executed because the main queue is hogged up making async calls. 响应被分派给main,但是由于主队列阻塞了进行异步调用,因此不执行响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM