问题
I am a new guy to iOS. Recently, I am developing an iOS application need to check image (in iOS Photos) created date time and modified date time to sort these images by time. I used ALAssetsLibrary to enumerate all images, i can get following attributes of each image: image file name, image asset url (within it, i can get image file extension and unique asset id). But could someone tell me how to get the image file created date time and last modified date time?
Thanks very much.
回答1:
You can retrieve the creation date of the asset using the ALAssetPropertyDate property:
ALAsset* asset;
...
NSDate* date = [asset valueForProperty:ALAssetPropertyDate];
I'm not sure of a method to retrieve the last modified date.
来源:https://stackoverflow.com/questions/10638567/how-can-i-get-image-created-date-time-or-last-modified-date-time-from-ios-photos