我的应用冻结,但没有出现错误 [英] My app freezes but no error appears

查看:225
本文介绍了我的应用冻结,但没有出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道我的应用程序是否冻结了什么?我的意思是,我可以在iPad屏幕上看到应用程序,但没有按钮响应。我已经尝试调试代码,当我点击按钮,但我还没有看到任何东西。我正在阅读有关仪器工具的信息;具体如何使用它们?



有人能帮我吗?我只需要说明如何使用这些工具。

解决方案

这听起来像是你以某种方式阻止了主线程。要调试,请在调试器中运行该应用程序,并在应用程序冻结时,点击Xcode底部日志区域上方的暂停按钮。然后在左边,你可以看到每个线程正在做什么,你可以看到它在哪里被卡住。





可能是主线程上的长循环或同步死锁。


Does any body know what I have to check if my app freezes? I mean, I can see the app in the iPad screen but no buttons respond. I have tried debugging the code when I click on the button, but I haven't seen anything yet. I was reading about the Instruments tools; specifically how do I use them?

Can anybody help me? I just need an explanation about how use the tools.

解决方案

It sounds like you've blocked the main thread somehow. To debug, run the app in the debugger and when the app freezes, hit the pause button above the log area at the bottom of Xcode. Then on the left side, you'll be able to see exactly what each thread is doing, and you can see where it's getting stuck.

Probably either a long loop on the main thread or a sync deadlock.

这篇关于我的应用冻结,但没有出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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