Reputation: 38162
I am observing that whenever I am profiling my application using instrument in Xcode 6.0.1, application hangs every time while I am browsing through the application. I am using iPhone 5S (iOS 8.0.2) to run my application. When I run the application on device it runs all fine.
Upvotes: 12
Views: 5262
Reputation: 6054
Upvotes: 1
Reputation: 1107
Extending on Abhinav's correct answer, NSLog() is indeed triggering the issue, but not all NSLogs, only some very large ones. In my case I was logging some long responses from a web service, and commenting only those ones out fixed the problem of Instruments hanging. I guess this is the reason why the issue is not as widespread as you'd think (I couldn't find any reference to it on Apple's dev forums).
Upvotes: 2
Reputation: 1450
I've just been solving the same issue and it turned out to be caused by something else. I'm not 100% sure yet which part of my code is responsible, but it's got something to do with accessing the internet. So I've switched into Airplane mode et voila! So my conclusion is that a network request was hanging the main thread (only when running Instruments tho -- weird) and if anyone else is running into similar problems, try finding what might hang your main thread.
Hope it saves some time :)
Z.
Upvotes: 1
Reputation: 38162
Found the fix - disabling the NSLog statements (profiling on release and not on debug) solved the issue for me.
Upvotes: 17