title: Importing multiple images from Photo Library to App
body: <p>I'm trying to create an app that will let you import photos from your Photo Library and insert them into designated UIImageViews. I was able to get this to work for one of the UIImageViews in my interface, but can't get any to assign to the second UIImageView.</p>
  
  <p>If anyone can tell me what I'm doing wrong I would greatly appreciate it! Thanks! SBB</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@implementation FlipBook2ViewController
  
  
  - (IBAction)selectExistingPicture {
      if ([UIImagePickerController isSourceTypeAvailable:
           UIImagePickerControllerSourceTypePhotoLibrary]) {
          UIImagePickerController *picker =
          [[UIImagePickerController alloc] init];
          picker.delegate = self;
          picker.allowsImageEditing = NO;
          picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
          [self presentModalViewController:picker animated:YES];
          [picker release];
      }
      else {
          UIAlertView *alert = [[UIAlertView alloc] 
                                initWithTitle:@"Error accessing photo library" 
                                message:@"Device does not support a photo library" 
                                delegate:nil 
                                cancelButtonTitle:@"Dismiss" 
                                otherButtonTitles:nil];
          [alert show];
          [alert release];
      }
  }
  
  
  - (IBAction)selectExistingPicture2 {
      if ([UIImagePickerController isSourceTypeAvailable:
           UIImagePickerControllerSourceTypePhotoLibrary]) {
          UIImagePickerController *picker =
          [[UIImagePickerController alloc] init];
          picker.delegate = self;
          picker.allowsImageEditing = NO;
          picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
          [self presentModalViewController:picker animated:YES];
          [picker release];
      }
      else {
          UIAlertView *alert = [[UIAlertView alloc] 
                                initWithTitle:@"Error accessing photo library" 
                                message:@"Device does not support a photo library" 
                                delegate:nil 
                                cancelButtonTitle:@"Dismiss" 
                                otherButtonTitles:nil];
          [alert show];
          [alert release];
      }
  }
  
  
  #pragma mark  -
  - (void)imagePickerController:(UIImagePickerController *)picker 
          didFinishPickingImage:(UIImage *)image
                    editingInfo:(NSDictionary *)editingInfo {
      imageView.image = image;
      [picker dismissModalViewControllerAnimated:YES];
  
  }
  - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
  
      [picker dismissModalViewControllerAnimated:YES];
  }
  </code></pre>