3

I am trying to call in a UIImagePickerView and sometimes when my camera view (with custom overlay) shows up it gives black preview initially. And after 15-30 seconds the black screens disappears. If the image is clicked with black camera screen, it still shows up in my UIImageView. I followed up with the following similar posts:

iOS 7 UIImagePickerController has black preview

and

iOS 7 UIImagePicker preview black screen

I tried doing both. I have managed all the UI jobs on specific background thread and the getter method fix in the second link. But it was not fixed completely either way.

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

I am still confused why is this bug actually occurring? how can it be reproduced? (as it appears sometimes only) and What's the right fix for this?

Community
  • 1
  • 1
am1991
  • 41
  • 2

1 Answers1

0

I ran into this same problem with the camera preview tonight, and the root cause of the problem was … completely unrelated code in the app delegate that modified UI on a background queue.

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

This article ( cocoanetics.com/2013/02/uiview-background-queue-debugging ) was very helpful in tracking down where the UI was being modified from a background queue.

Mike Hay
  • 2,828
  • 21
  • 26