从所选照片imagePickerController获取日期和时间

时间:2015-04-30 16:54:31

标签: ios uiimagepickercontroller

当用户从照片中选择图像时,如何从所选图像中获取日期和时间。请提前感谢!

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{

        //dismiss imagepicker controller
    [self dismissViewControllerAnimated:NO completion:nil];

}

1 个答案:

答案 0 :(得分:1)

试试这个:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

NSDictionary *metadataDictionary = (NSDictionary *)[info valueForKey:UIImagePickerControllerMediaMetadata];
    // do something with the metadata

NSLog(@"meta : %@ \n\n",metadataDictionary);

}