Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay UIAlertView before launching UIImagePickerController
    text
    copied!<p>My app asks the user via a UIActionSheet where they want to import an image from (Photo Library or Camera) and then launches the appropriate UIImagePickerController.</p> <p>If the user selects Camera I want to first display a UIAlertView with a camera instructions image relevant to the app. This works, however the UIImagePickerController is launched while the alert is still on the screen and appears behind it. How can I launch the camera only once the user has dismissed the UIAlert?</p> <pre><code>-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex { if (buttonIndex != [actionSheet cancelButtonIndex]) { // User hasn't canceled, launch chosen photo source NSString *selectedButtonTitle = [actionSheet buttonTitleAtIndex:buttonIndex]; if ([selectedButtonTitle isEqualToString:@"Camera"]) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"\n\n\n\n\n\n\n\n\n\n" delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil]; UIImageView *cameraHelpView = [[UIImageView alloc] initWithFrame:CGRectMake(82, 46, 120, 160)]; UIImage *cameraTutorial = [UIImage imageNamed:@"cameraTutorial.png"]; cameraHelpView.image = cameraTutorial; [alert addSubview:cameraHelpView]; [alert show]; [alert release]; UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera; [self presentModalViewController: picker animated: YES]; [picker release]; } </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