title: Using UIImagePickerController in UIView
body: <p>I have button which when I click displays the camera (works perfectly) </p>
  
  <pre><code>- (IBAction)getPhoto:(id)sender
  {
      NSLog( @"Button clicked!" );
      imagePicker = [[UIImagePickerController alloc] init];
      imagePicker.delegate = self;
  
      if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
          [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
      }
  
      else {  // IF the device doesn't have a camera, so use the photos album
          [imagePicker setSourceType:UIImagePickerControllerSourceTypeSavedPhotosAlbum];
      }
  
      [self addSubview:imagePicker.view];
  }
  </code></pre>
  
  <p>After which I can take an image, etc, - But when I click "use" : nothing happens here is my method : the Image picker does not dismiss itslelf : the application simply does nothing, I'm trying to take the image I just took and display it inside a CGRect on screen .</p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
      [picker dismissViewControllerAnimated:YES completion:NULL];
  
      UIImageView *patientImage = [[UIImageView alloc] init];
      patientImage.frame = CGRectMake(625, 25, 83, 103);
  
      UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
      self.patientImage.image = chosenImage;
  }
  </code></pre>
  
  <p>Even when I hit the cancel button without taking an image, the imagePicker (camera interface) does not dismiss itself </p>
  
  <p>Any help, advice, or guidance would be very appreciated.</p>