title: ios how dismiss UIImagePickerController after use
body: <p>I develop an app that take a picture from camera unitl here all well bat after receive from his delegate i dismiss and i receive exc_bad_access here is the code:</p>
  
  <p>declare and open the camera:</p>
  
  <pre><code>-(void)ScattaFoto{
   UIImagePickerController *picke = [[UIImagePickerController alloc] init];
     // Delegate is self
     picke.delegate = self;
  
      // Allow editing of image ?
  picke.allowsEditing=NO;
  
  
  if(TARGET_IPHONE_SIMULATOR) {
        picke.sourceType =  UIImagePickerControllerSourceTypePhotoLibrary;
       }else{
      picke.sourceType =  UIImagePickerControllerSourceTypeCamera;
      }
  
     // Show image picker
  [self presentModalViewController:picke animated:YES];   
  </code></pre>
  
  <p>}</p>
  
  <p>and than is the delegate event:</p>
  
  <pre><code>- (void) imagePickerController:(UIImagePickerController *)picke   didFinishPickingMediaWithInfo:(NSDictionary *)info
  {
  // Access the uncropped image from info dictionary
  //UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
  
  // [picker release];
  [self  dismissModalViewControllerAnimated: YES]; // Here i receive exc_bad_access
  [picke release];
  }
  </code></pre>
  
  <p>i put on .h the refer to delegate of imagePickerControl "UINavigationControllerDelegate, UIImagePickerControllerDelegate"</p>
  
  <p>Someone can help me?</p>