Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I diagnose blocking in an iOS app?

So, I've got an iOS app which works nicely - usually, except the UI occasionally blocks. Is there a standard technique for diagnosing sporadically unresponsive UI?

In my case, I've got LRResty pulling data asynchronously, and the resultant data is parsed by NSXMLParser into some NSMutableArray objects.

I'd pin it on the XML parsing, but the UI doesn't block consistently in place. It blocks primarily after tapping the back button on my UINavigationBar, but also the initial table view doesn't scroll until the search bar is interacted with. Could there be a parser still working, or a request still working?

like image 300
Moshe Avatar asked Mar 30 '12 15:03

Moshe


1 Answers

I use "Time Profiler" in instruments to see which methods are causing the unresponsive UI

Screenshot
(source: bmxmdb.com)
.

I just run it without touching anything, do the action in the app that you need to test, then stop recording, and after a lot of drilling down you find the offending method(s) this is my app accessing the DB.

like image 81
Nick Avatar answered Sep 24 '22 17:09

Nick