title: send image between views using prepareForSegue
body: <p>I am working on an Iphone application using storyboard.</p>
  
  <p>I have a button in a view (SelectionViewController) and when the user clicks on the button, it goes to another view (ImagesResultsViewController) (.</p>
  
  <p>What I need is to send an image from the first view to the second. for that I named the segue identifier "resultViewSegue" and used the prepareForSeague method to get reference to the destination view and place the image in a UIImage view on it:</p>
  
  <pre><code>- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      //if the segue identifier is "resultViewSegue"
      if([segue.identifier isEqualToString:@"resultViewSegue"])
      {
          //get the destination view which is ImagesResultsViewController
          ImagesResultsViewController * destinationView = segue.destinationViewController;
  
          //Set the image in the UIImageView
          [destinationView.mainImageView setImage:myImageToSend];
          //mainImageView is a UIImageView in the "ImagesResultsViewController" I created a property for it and synthesize it
      }
  }
  </code></pre>
  
  <p>However the image was not set. after debugging I found out that the <code>destinationView.mainImageView</code> is  null. How can I get a reference of the UIImageView and set its picture from the segue?</p>
  
  <p>Thank a lot for any help</p>