title: Ipad UIImagePickerController and UIPopoverController error
body: <p>I am using this code to open a popover with imagepicker</p>
  
  <pre><code>-(IBAction)photosAction:(id)sender 
  {
  // dismiss any left over popovers here
  UIImagePickerController* picker = [[UIImagePickerController alloc] init]; 
  picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
  picker.delegate = self; 
  
  UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker];
  self.popoverController = popover;          
  popoverController.delegate = self;
  [popoverController presentPopoverFromBarButtonItem:sender  permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
  [picker release];
  </code></pre>
  
  <p>But this results in this error <strong>request for member 'popoverController' in something not a structure or union</strong> and this error <strong>'popoverController' undeclared (first use in this function)</strong>.</p>
  
  <p>Also I want to dismiss the popover when the image is selected.</p>
  
  <p>What code should I put in the following function to dismiss the popover once the image is selected.</p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
  </code></pre>
  
  <p>Thanks for the help!</p>