title: iOS: UIImageView Issues
body: <p>I'm very new to Objective-C, and am having some beginner issues. I have an application that has an area that is supposed to behave somewhat like a photo gallery. You click the "Add Image" button, and the image selected from the camera roll goes into a UIImageView. This is the code I'm using:</p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
      imageView.image = img;
      [[picker parentViewController] dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>Now, I added in multiple UIImageViews, so that they can click "Add Image", and each time they select an image from the camera roll, the image will display in the next available UIImageView. This is where I'm having issues. I'm not sure how to do this, but this is the code that I've been trying to use to accomplish this:</p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
      if (imageView == nil) {
          imageView.image = img;
          [[picker parentViewController] dismissModalViewControllerAnimated:YES];
      }
  
      if (imageView2 == nil) {
          imageView2.image = img;
          [[picker parentViewController] dismissModalViewControllerAnimated:YES];
      }
  
      if (imageView3 == nil) {
          imageView3.image = img;
          [[picker parentViewController] dismissModalViewControllerAnimated:YES];
      }
  }
  </code></pre>
  
  <p>I have two issues here. The first issue is that this version of my code does not add the image at all like the 1st version of code I posted does. I suspect that its because the imageView's do not equal nil for some reason. I'm not sure how to fix that. The second issue is that if this code were to work, all of the UIImageViews will display the picture, rather than just the next available UIImageView. I tried putting "break;" after each if statement, but of course that caused an error because this is not a loop. Any help or advice is much appreciated, thank you!</p>