When a user picks a photo from an iPhone's camera roll, I can access the photo's date and time information.
How can I get the date information from an arbitrary UIImage or a picture in Cocoa Touch?
When a user picks a photo from an iPhone's camera roll, I can access the photo's date and time information.
How can I get the date information from an arbitrary UIImage or a picture in Cocoa Touch?
In iOS 4 you can use the UIImagePickerControllerMediaMetadata to fetch the data. There's some Example Code by Apple. The answers to this question might help as well.
Its Working fine:
-(void)dateInfo
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSFileManager *manager = [NSFileManager defaultManager];
NSArray *fileList = [manager contentsOfDirectoryAtPath:documentsDirectory error:nil];
//--- Listing file by name sort
NSLog(@"\n File list %@",fileList);
int num;
//-- Listing file name with modified dated
for (NSString *s in fileList)
{
NSString *filestring = [documentsDirectory stringByAppendingFormat:@"/%@",s];
NSDictionary *filePathsArray1 = [[NSFileManager defaultManager] attributesOfItemAtPath:filestring error:nil];
NSString *modifiedDate = [filePathsArray1 objectForKey:NSFileModificationDate];
NSLog(@"\n Modified Day : %@", modifiedDate);
num=num+1;
}
}