Note that there are some explanatory texts on larger screens.

plurals
  1. POException in iPad, UIImagePickerController must be presented via UIPopoverController
    primarykey
    data
    text
    <p>I have created an application for capture image from camera. This is my code</p> <pre><code> -(IBAction) showCameraUI { BOOL hasCamera = [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]; UIImagePickerController* picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = hasCamera ? UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:picker animated:YES]; } </code></pre> <p>And implemented this delegate method for get the captured image</p> <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; UIImage* image = [info objectForKey:UIImagePickerControllerOriginalImage]; UIImage *yourImageView = image; } </code></pre> <p>Implemented this method if user cancel the controller</p> <pre><code>- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker { [picker dismissModalViewControllerAnimated:YES]; } </code></pre> <p>But it shows this exception. Does anyone have any idea why it is showing such exception after executing last line of function showCameraUI.</p> <pre><code>UIStatusBarStyleBlackTranslucent is not available on this device. 2013-02-07 10:06:06.976 CaptureImage[460:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'On iPad, UIImagePickerController must be presented via UIPopoverController' </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload