title: How to access iOS simulator camera
body: <p>I am making a camera app. I need to test the app in the simulator but I can't access the iOS simulator camera.</p>
  <p>If not possible in the simulator means I need to access my system camera. Whether it is possible?</p>
  <p>I tried <code>UIImagePickerController</code> but it doesn't work.</p>
  <p>The below the code I've tried.</p>
  <pre><code>self.imagePicker = [[UIImagePickerController alloc] init];  
  UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
  self.usingPopover = YES;
  if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
  sourceType = UIImagePickerControllerSourceTypeCamera;
  self.usingPopover = NO;
  }
  [self.imagePicker setSourceType:sourceType];
  self.imagePicker.allowsEditing = NO;
  self.imagePicker.delegate = self;
  if (sourceType != UIImagePickerControllerSourceTypeCamera) {
  self.popover = [[UIPopoverController alloc] initWithContentViewController:self.imagePicker];
  self.popover.delegate = self;
  [self.popover presentPopoverFromRect:popoverFrame inView:self.view  
  permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
  } else {
  [self presentModalViewController:imagePicker animated:YES];    
  }
  </code></pre>