I am creating a window-based application (I am using window-based because I like how the universal apps are organized), but I am having trouble with the UIImagePickerControllerSourceTypeCamera. I want to have two views:
the parent view: a menu screen
the sub view: the screen where you can choose the photo from a gallery or where you can use the camera to take a photo
The main issue is, when I push the button to take a picture with the camera, it works and I can see the camera controls, and I can even take a picture with no problem. However, whatever objects that are in the parent view are covering the "viewfinding" screen. (i.e. if I am pointing my camera to a flower, I can see the flower on the screen, but there are buttons and imageviews from the parent view overlayed on it. I hope that makes sense).
I am adding the ImagePickerController as a modal view. You can see the code below. When I choose photo from album, it seems to be working okay, but when I try to take a picture with the camera, it is like it is sent to the back of everything.
Code:
-(IBAction)SetImage:(id)sender{
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
if((UIButton *) sender == ChoosePhoto) {
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
} else {
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
}
[self presentModalViewController:picker animated:YES];
}
Maybe I am just missing something really obvious. Any help would greatly be appreciated. Thanks!