IOS 7 UIImagePickerView shows black preview first

I am trying to call UIImagePickerView and sometimes when my camera view (with custom overlay) appears it gives a black preview at first. And after 15-30 seconds the black screens disappear. If the image is clicked on the black camera screen, it is still displayed in my UIImageView. I have done the following similar posts:

iOS 7 UIImagePickerController has black preview

and

iOS 7 Black Screen UIImagePicker Preview

I tried to do both. I have done all the UI jobs on a specific background thread and the getter method on the second link. But it hasn't been completely fixed.

Here is another similar question explaining the problem I was facing, iDevice camera shows black instead of preview

I am still confused, why is this error actually happening? how can it be reproduced? (as it sometimes happens) and what needs to be fixed for this?

+3


source to share


1 answer


I ran into this issue today with camera preview and the root cause of this issue was ... completely unrelated code in the app delegate that changed the interface in the background.

Once I removed the calls to the UI code from the background queues, the camera preview became fast and reliable.



This article (cocoanetics.com/2013/02/uiview-background-queue-debugging) was very helpful in keeping track of where the UI was changed from the background queue.

0


source







All Articles