i have a little problem with dismissing my camera view.
im using the UIImagePickerController with this code-
-(void)viewDidAppear:(BOOL)animated{
UIImagePickerController *picker=[[UIImagePickerController alloc]init];
picker.delegate=self;
picker.sourceType=UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls=NO;
[picker.cameraOverlayView addSubview:mirrorOverlay];
picker.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:picker animated:YES];
[picker release];}
im using a custom button to close the camera and change the view back to my main view using this code-
-(IBAction)flipBack:(id)sender{
[self dismissModalViewControllerAnimated:YES];
my problem is when im pressing the button the View flipout and then going back in and call the camera again.
i can’t find a way to dismiss the camera and the view.
Please help.
Thanks,
Amir.
Update:
Thanks for the help ! i figure it out !
my problem was that i was working with nib files of the camera, and when you want to use the camera in different way that was described on the delegate you should use View and not nib.
so my code was correct but in the wrong place and format.
Thanks all !
if someone need help with it, I’m here to help back !
you need to dismiss the picker, by the looks of it you’re dismissing the controller that presents the picker.
You need to keep a reference to the
pickerin this case (e.g: add UIImagePicker *picker; as a member to your viewcontroller class).