This question already has an answer here:
How to display images by sorting date modified type from gallery. I can get data from folder using
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSFileManager *manager = [NSFileManager defaultManager];
Also how to compare uiimage by date modified.
Thanks in Advance....
You can get attributes of image using this code
You can get modified date using this code
Create NSMutableDictionary and and put modified date as key and path as value.
Then you can sort keys of imagesDict
and then you can make cycle for sortedDates items and get sorted by date pathes for your images
Another solution:
Simplest way:
For that you have to used ALAssetsLibrary to enumerate all images from gallery.
From that you have fetch attributes of each image:
and your answer is here:
You can retrieve the creation date of the asset using the ALAssetPropertyDate property:
may be it will help you.