Getting image name of iphone photo library

╄→尐↘猪︶ㄣ 提交于 2020-01-21 06:13:34

问题


I'm doing a project to take images from iphone photo library or in other way from camera roll. I have done that without any problem. But i need to retrieve the name from the photo library. Is there a way to do that? Any help is appreciated

Thanks


回答1:


Have a look at ALAssetsLibrary which is available in iOS 4.0 and later.

Also, these links may help

How to get a photo's original filename in iOS?

iPhone: How do I get the file path of an image saved with UIImageWriteToSavedPhotosAlbum()?




回答2:


If you need the full path, just use this:

ALAsset* asset;   // previously assigned
NSDictionary* pathInfo = [asset valueForProperty:ALAssetPropertyURLs];

This will leave the full URL of the image on your device as the Value member of the pathInfo object.



来源:https://stackoverflow.com/questions/9784887/getting-image-name-of-iphone-photo-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!