UIImagePickerController not displaying correctly in iOS 8

I would like to introduce a UIImagePickerController with the following code:

self.pickerController = [[UIImagePickerController alloc] init]; self.pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.pickerController.delegate = self; [self presentViewController:self.pickerController animated:YES completion:nil]; 

It works fine for iOS 7 and below, but in iOS 8 I got the following crash:

  • When switching to the image selection controller (animation with a vertical cover), the background color of the pick-up controller is invisible, showing the presentation controller that displays below. After the transition is completed, the selection table view will appear suddenly without animation.

  • Sometimes the selection table view is not displayed at all, and instead I got a blank black screen. The navigation bar still exists, but the panel elements are not displayed, so the user must force the exit from the application.

Does anyone know what is going on here?

+3
source share
1 answer

So, I managed to find the cause and fix these problems and I want to document it here:

  • The first problem arose when I tried to compile an iOS 8 device with Xcode 5.1. I switched to Xcode 6 beta 2 and now it works fine.

  • The second problem occurred when I tried to reuse the UIImagePickerController, which was shown earlier. Create a new instance before displaying and it will be fixed.

Greetings.

+7
source

Source: https://habr.com/ru/post/1204339/


All Articles