
284
Capítulo 8
#pragma mark UIImagePickerControllerDelegate methods
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickin
gMediaWithInfo:(NSDictionary *)info
{
// Construct the path to the file in our Documents Directory.
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocu
mentDirectory, NSUserDomainMask, YES) lastObject];
NSString *uniqueFilename = [[NSUUID UUID] UUIDString];
NSString *imagePath = [documentsDirectory stringByAppendingPathComponent:u
niqueFilename];
// Get the image from the picker and write it to disk.
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
[UIImagePNGRepresentation(image) ...