UIImagePickerController shows last picture taken instead of camera input
Posted
by
jules
on Stack Overflow
See other posts from Stack Overflow
or by jules
Published on 2013-11-06T15:13:04Z
Indexed on
2013/11/06
15:53 UTC
Read the original article
Hit count: 458
I'm having a strange behaviour within my app. For taking pictures i'm using the following pretty standard code for displaying the UIImagePickerController:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:nil];
It works perfectly fine the first time I tap the button which calls this action. The strange behaviour starts when I tap that button again. The UIImagePickerController starts again BUT it doesnt show the input from the camera anymore. It shows the last picture I've taken.
More Details of this state:
- Tapping on the image shows the yellow square of the auto focus. (which it actually uses to focus the camera correctly)
- When I tap on the ImageCapture button -> the correct image is taken and presented on the screen.
- If I take a picture and press 'Retake' the regular camera image is presented as input.
More weirdness: It has nothing to do with the iPad I'm using. Creating a new example app which only has button which calls the code from above everything works perfectly fine.
I assume it has something to do with the configuration of the app. Therefore I checked everything but could not find any differences which may cause this issue.
Thanks in advance for any advice!
Update: I do implement the UIImagePickerControllerDelegate in order to dismiss the UIImagePickerController.
© Stack Overflow or respective owner