Objective-C : UIImagePickerControllerReferenceURL 获取ID

Objective-C : UIImagePickerControllerReferenceURL get ID

当用户使用 UIImagePickerController 选择图像时,UIImagePickerControllerReferenceURL 给出以下信息:

UIImagePickerControllerReferenceURL = "assets-library://asset/asset.PNG?id=7F96E032-2342-4FED-B0A6-EE0EC3C7A540&ext=PNG

有人可以告诉我如何从这个 URL 中提取 ID 吗? (7F96E032-2342-4FED-B0A6-EE0EC3C7A540)

此外,我假设这对于每张图片都是唯一的值?这是正确的吗?

Can somebody please tell me how it is possible to pull out the id from this URL

想都别想了

改为使用照片工具包。您拥有资产 URL,因此使用 fetchAssetsWithALAssetURLs:options: 获取资产。现在询问资产的 localIdentifier。这是唯一标识符。