title: How to pass image, from uiimagepickercontroller, into another scene's uiimageview
body: <p>How do I save a <code>UIImagePickerController</code> camera image so I can send to <code>CreateViewController</code> scene's <code>UIImageView</code>?</p>
  
  <p><code>HomeViewController</code>(scene 1) has a button that loads <code>UIImagePickerController</code> and returns with an image from the camera. <code>CreateViewController</code>(scene 2) has an empty <code>UIImageView</code>. </p>
  
  <p><strong>HomeViewController.h</strong></p>
  
  <pre><code>#import "CreateViewController.h"
  
  @interface HomeViewController : UIViewController
  &lt;UIImagePickerControllerDelegate, UINavigationControllerDelegate&gt;
  
  @property (strong, nonatomic) UIImagePickerController *imagePicker;
  @property(nonatomic, retain) UIImage *myImage;
  
  - (IBAction)cameraImage:(id)sender;
  </code></pre>
  
  <p><strong>HomeViewController.m</strong></p>
  
  <pre><code>@implementation HomeViewController
  @synthesize imagePicker, myImage;
  
  -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  
  if ( [segue.identifier isEqualToString:@"create"]) {
      CreateViewController *cvc = [segue destinationViewController];
      UIImage *image = myImage;
      cvc.myImage = image;
  
  }
  }
  
  //Camera button action
  - (IBAction)cameraImage:(id)sender{
  //UIImagePickerController space in memory
  imagePicker = [[UIImagePickerController alloc]init];
  //Set the delegate
  imagePicker.delegate = self;
  //Set the sourceType
  imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
  //Show Image Picker UI
  [self presentViewController:imagePicker animated:YES completion:^{}];
  }
  
  -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:    (NSDictionary *)info {
  
  self.myImage = [info objectForKey:UIImagePickerControllerOriginalImage];
  
  [self dismissViewControllerAnimated:YES completion:^{}];
  
  [self performSegueWithIdentifier:@"create" sender:self];
  }
  
  - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
  {
  [self dismissViewControllerAnimated:YES completion:^{}];
  }
  </code></pre>
  
  <p><strong>CreateViewController.h</strong></p>
  
  <pre><code>@property (strong, nonatomic) IBOutlet UIImageView *bgImage;
  @property(nonatomic, retain) UIImage *myImage;
  </code></pre>
  
  <p><strong>CreateViewController.m</strong></p>
  
  <pre><code>@implementation CreateViewController
  @synthesize bgImage, myImage;
  
  - (void)viewDidLoad
  {
  [super viewDidLoad];
  UIImage *image = myImage;
  [bgImage setImage:image];
  }
  </code></pre>
  
  <p>Download sample code here; <a href="http://code-blind.com/ios6-camera-picture-to-another-scenes-uiimageview/" rel="nofollow">http://code-blind.com/ios6-camera-picture-to-another-scenes-uiimageview/</a></p>