title: UIImagePickerController didFinishPickingMediaWithInfo
body: <p>Bellow is my didFinishPickingMediaWithInfo method and I know that I have a lot of unnecessary code, retains, releases, etc... But this was the way I could get it to work and I'm afraid of breaking it on trying to optimize it.</p>
  
  <p>Can anyone help me on taking off the unnecessary stuff and have this method clean?</p>
  
  <p>Also, I have a view controller that will load up 4 photos (Camera Roll or Camera) and after the 2nd or 3rd photo selection at the picker, the app crashes or at least, I got one of these alerts below. What I'm doing wrong? THanks!</p>
  
  <p>-2012-06-23 10:54:07.399 LookdoDia[6525:707] Received memory warning.</p>
  
  <p>-wait_fences: failed to receive reply: 10004003</p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
  
      [self dismissModalViewControllerAnimated:YES];   
  
      UIImage *img = [info objectForKey:UIImagePickerControllerEditedImage];
      if(!img) img = [info objectForKey:UIImagePickerControllerOriginalImage];
  
      uiimvImagem.image = [img retain];
      uiimvImagem.alpha = 0;
      UIImageView *tempImageView = [[UIImageView alloc] initWithImage:img];
      self.uiimvImagem = [tempImageView retain];
      [tempImageView release];
  
      CGRect frame = uiimvImagem.frame;
      frame.size.width = 359;
      frame.size.height = img.size.height / (img.size.width / 359);
      uiimvImagem.frame = frame;
  
      uisv1.showsVerticalScrollIndicator = NO;
      uisv1.showsHorizontalScrollIndicator = NO;
      uisv1.contentSize = CGSizeMake(uiimvImagem.frame.size.width, uiimvImagem.frame.size.height);
      uisv1.maximumZoomScale = 3.0;
      uisv1.minimumZoomScale = 0.8;
      uisv1.clipsToBounds = YES;
      uisv1.delegate = self;
  
      [uisv1 addSubview:uiimvImagem];
  
      [img release];
  
  }
  </code></pre>