Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIViewController - mysteriously slow to load

I'm writing a tab-based universal app where one of the tabs takes considerably much longer to load than the rest (approximately 5s), and it locks down the main thread while doing it.

Now, this specific tab is an image gallery, so it could be expected to take a little while to load and display the images, however, the delay occurs before I instantiate any of my variables... (The image loading is done on a separate thread anyway...)

I create my subviews etc. in the viewDidLoad method, but the delay occurs somewhere after the init method and before the viewDidLoad method.

(The delay is present even if I comment out everything in the viewDidLoad method.)

The View Controller is initialized with a nib containing nothing but a UIScrollView and a UIImagePickerController...

Does anyone know what's being loaded/processed before the viewDidLoad method?

like image 771
david.emilsson Avatar asked Nov 22 '11 17:11

david.emilsson


1 Answers

This is a problem with loading UIImagePickerController on the phone while being attached to the xcode harness. This creates a longer than normal delay. Try testing on the device without being connected to the xcode debugger.

like image 142
Matt G Avatar answered Oct 16 '22 23:10

Matt G