My app freezes but no error appears

Vanjo picture Vanjo · Apr 17, 2012 · Viewed 19.1k times · Source

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.

Answer

Ben Baron picture Ben Baron · Apr 17, 2012

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.

pause button

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