I have a view controller that displays when I click on one of the tabs in the tabBarController. In this view of the controller, I initialize the UIImagePickerController in the viewDidLoad method:
- (void)viewDidLoad { [super viewDidLoad];
The goal is then to display the UIImagePickerController later when the button is pressed. For some reason, although when you click the tab icon for this view controller, it hangs for 3-4 seconds while this viewDidLoad method is running. When I comment on the line _imagePicker = [[UIImagePickerController alloc] init], there is no response time, and the view controller loads immediately - as it should be.
Does anyone know why allocating and initializing a UIImagePickerController takes so much time? If so, is there a way to speed it up besides running it as a background process? This seems to be abnormal behavior.
I am using iOS7 and I am not calling viewWillAppear or viewDidAppear.
source share