title: iPhone UIImagePickerController didFinishPickingImage: UIImage transfer between view controllers?
body: <p>In my app, I have a UIImagePickerController. When a image is selected, my view controller needs to get the image and pass it to another view controller, which is pushed onto self.navigationController. But I am always getting SEGFAULTS or nil arguments, and things like that. I would appreciate it if you could tell me what is wrong with this code:</p>
  
  <p>FirstViewController.m:</p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
   self.currentpicture = [img copy];
   [self dismissModalViewControllerAnimated:YES];
   [self goNext];
  }
  -(void)goNext{
   SecondViewController *vc = [[SecondViewController alloc] initWithNibName:@"Second" bundle:nil];
   [vc giveMePicture:currentpicture];
   [self.navigationController pushViewController:vc animated:YES];
  }
  </code></pre>
  
  <p>SecondViewController.m:</p>
  
  <pre><code>-(void)giveMePicture:(UIImage *)data {
   self.currentpicture=[data copy];
  }
  </code></pre>
  
  <p>They both have currentpicture defined as a UIImage *currentpicture;<br>
  I now <em>should</em> have currentpicture as some data, but it crashes every time! I have tried many different things and I cannot figure this out. </p>