iPhone SDK 3.0 GM

Posted in iPhone, Me, Objective-C, Programming, Projects on Jun 09, 2009

While looking into my app for deprecated methods I have found one that did not have much documentation to it. It was a delegate method from UIImagePickerControllerDelegate and this is the way I use it for when an image is ready to be posted.

- (void)imagePickerController: (UIImagePickerController *)picker didFinishPickingImage: (UIImage *)img editingInfo: (NSDictionary *)editInfo {
  [[picker parentViewController] dismissModalViewControllerAnimated:YES];
  [image setImage:img];
  [self confirmPhotoUpload];
}

Now the only problem with that method above is that it is now deprecated in the iPhone OS 3.0 SDK and you must now use a method called imagePickerController:didFinishPickingMediaWithInfo:
and the way I use that method is like this:

- (void)imagePickerController: (UIImagePickerController *)picker didFinishPickingMediaWithInfo: (NSDictionary *)info
{
  [[picker parentViewController] dismissModalViewControllerAnimated:YES];
  UIImage * img = [info objectForKey:@"UIImagePickerControllerEditedImage"];
  [image setImage:img];
  [self confirmPhotoUpload];
}

So if your stuck trying to figure out what method to now use, use imagePickerController:didFinishPickingMediaWithInfo: and what will have a NSDictionary with all the needed information about the image.

Comments are closed.

  • Recent Comments