iPhone Camera Iris / Shutter stuck in closed position

dana0550 picture dana0550 · Nov 9, 2011 · Viewed 10.8k times · Source

As the title states the app that I am developing has an issue that is caused only when the app is relaunched after entering the background.

The camera iris or shutter gets stuck in the closed position. The funny thing is you can still take a picture but you cannot see the preview. Once the picture is taken, it is shown correctly in the view.

This issue does not happen when the app is launched if the app is completely closed. I can take pictures, add effects and so on, every time the camera is opened it works correctly.

Here are the exact steps to reproduce the issue:

1) I open the app, everything works fine.

2) The app enters the background either by pressing the home button or incoming call.

3) When the app enters the foreground / reopened and the camera is accessed the shutter screen is shown and remains closed in the stuck position.

4) The only way to fix it is to dismiss the modal view camera controller and press the camera button again.

I have done some research to find an answer and have come up with nothing. There are no memory leaks and I have checked the memory allocations in instruments and there is nothing unusual.

Hopefully someone has a solution, I appreciate the help.

Thank you in advance.

Answer

SWoo picture SWoo · Nov 11, 2011

I'm having the exact same issue, but narrowed down a bit - it only happens with iOS 5. With some hints from other people talking about memory, I freed up as much memory as possible before presenting the UIImagePickerController and the problem stopped happening.