title: Need help hendling (dismissing) ImagePicker (camera) in objective-c (iphone)
body: <p>i have a little problem with dismissing my camera view.
  im using the <strong>UIImagePickerController</strong> with this code-</p>
  
  <pre><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];}
  </code></pre>
  
  <p>im using a custom button to close the camera and change the view back to my main view using this code-</p>
  
  <pre><code>-(IBAction)flipBack:(id)sender{
  [self dismissModalViewControllerAnimated:YES];
  </code></pre>
  
  <p>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.</p>
  
  <p>Please help.
  Thanks,
  Amir.</p>
  
  <hr>
  
  <p>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.</p>
  
  <p>so my code was correct but in the wrong place and format.
  Thanks all !  </p>
  
  <p>if someone need help with it, I'm here to help back !</p>