【问题标题】:Local address of the photo or image taken with UIImagePickerController使用 UIImagePickerController 拍摄的照片或图像的本地地址
【发布时间】:2014-08-21 09:56:42
【问题描述】:

我使用 UIImagePickerController 来拍照或从相册中选择它。这里我把选中的图片放到了imageView中:

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

    UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
    self.temporaryImageView.image = chosenImage;
    [picker dismissViewControllerAnimated:YES completion:NULL];
}

但是我如何才能在设备上获取所选照片的​​地址?还是它的名字?有可能吗?

【问题讨论】:

  • 如果你读到info 和它的UIImagePickerControllerMediaMetadata 键值怎么办?

标签: ios uiimagepickercontroller


【解决方案1】:

也许这对你有帮助;

NSMutableString *imageName = [[[NSMutableString alloc] initWithCapacity:0]];

CFUUIDRef ref = CFUUIDCreate(kCFAllocatorDefault);
if (ref) {
    [imageName appendString:NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID))];
}
[imageName appendString:@".png"];

我也建议你检查这个答案; https://stackoverflow.com/a/16184616/2622013

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-22
    • 2011-07-13
    • 1970-01-01
    • 2012-12-18
    相关资源
    最近更新 更多