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.
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.
Force stop a frozen app: You should force stop the faulty apps. To do this, go to the settings of your phone> Apps> tap on the app> tap on Force Stop> confirm.
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.
Top answer is correct. You can debug this with "Pause" option. Most common way to block main thread is to call dispatch_sync
on the same thread you dispatching. Sometimes you call same code from dispatch_once
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With