Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Make sure you don't call presentModalViewController:animated: twice before dismissModalViewControllerAnimated: It helped in my case.</p> <pre><code>- (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType { if (_imagePickerController!=nil || _imagePopoverController!=nil) { return; } _imagePickerController = [[[UIImagePickerController alloc] init] autorelease]; _imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext; _imagePickerController.sourceType = sourceType; _imagePickerController.delegate = self; switch (sourceType) { case UIImagePickerControllerSourceTypeCamera: _imagePickerController.showsCameraControls = YES; [self presentViewController:_imagePickerController animated:YES completion:nil]; break; default: _imagePopoverController = [[UIPopoverController alloc] initWithContentViewController:_imagePickerController]; _imagePopoverController.delegate = self; CGRect rect = [[UIScreen mainScreen] bounds]; rect.origin.y = rect.size.height - 70.0; rect.size.height -= rect.origin.y; [_imagePopoverController presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; break; } } - (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker { [_imagePopoverController dismissPopoverAnimated:YES]; _imagePopoverController = nil; [_imagePickerController dismissViewControllerAnimated:YES completion:nil]; _imagePickerController = nil; } - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info { UIImageWriteToSavedPhotosAlbum([info objectForKey:UIImagePickerControllerOriginalImage],nil,nil,nil); _currentImage = [info objectForKey:UIImagePickerControllerOriginalImage]; [_imagePopoverController dismissPopoverAnimated:YES]; _imagePopoverController = nil; [_imagePickerController dismissViewControllerAnimated:YES completion:nil]; _imagePickerController = nil; } </code></pre>
 

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