且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何获取UIImagePickerController选取的图像的原始文件名?

更新时间:2021-11-16 09:19:49

您可以使用信息词典的 UIImagePickerControllerReferenceURL 值而不是 UIImagePickerControllerOriginalImage 。这应该会为您提供原始媒体项目的URL。

You could use the UIImagePickerControllerReferenceURL value of the info dictionary instead of the UIImagePickerControllerOriginalImage. This should give you the URL to the original media item.

这将返回一个 NSURL 对象,然后您可以用来构建你的新文件名。

This would return you a NSURL object which you then can use to build your new filename from.