views:

41

answers:

1

Hi there,

I have a UIImagePickerController as a synthesized property of my view controller.

In general it works fine (takeing/picking photos, calling back, etc). However, when I receive a memory warning (didReceiveMemoryWarning is called on the view controller), although the app seems to handle it gracefully (viewDidLoad gets called for the view to get set up again without any extraneous views etc - app doesn't crash) and the UIImagePickerController lets me take a photo, the UIImagePickerController's view (in this case the camera) doesn't get dismissed. The camera just stays on the screen with the Retake and Use buttons greyed out.

I have tried setting self.imagePicker = nil in viewDidUnload and have also tried NOT doing this (so the view controller hasn't 'forgotten' it when it needs to dismiss it after the memory warning).

After the photo is taken after the memory warning, the imagePicker does callback successfully (didFinishPickingMediaWithInfo), but the imagePicker view remains on the screen.

Any help/ideas would be greatly appreciated.

A: 

Thanks very much to Kalle for commenting and, basically, solving the issue.

The answer was that I not only needed to make sure the imagePicker wasn't being set to nil in viewDidUnload, but I then needed to remove/dismiss it in didReceiveMemoryWarning. So simple when you know the answer - doh!! ;o)

Thanks again, StackOverflow.

happy pig
Happy to hear you got it solved. :)
Kalle