我正在开发iphone应用程序,对图像w.r.t图像捕获时间进行排序。
如何获取图像捕获时间?
感谢。
答案 0 :(得分:2)
- (void) imagePickerController: (UIImagePickerController *) picker
didFinishPickingMediaWithInfo: (NSDictionary *) info {
NSDictionary *metadata = [[NSDictionary alloc] initWithDictionary:[info objectForKey:UIImagePickerControllerMediaMetadata]];
NSDictionary *exifData = [[NSDictionary alloc] initWithDictionary:[metadata objectForKey:@"{Exif}"]];
NSString *captureDate = [exifData objectForKey:@"DateTimeOriginal"];
NSLog(@"Date: %@", captureDate);
}
结果: 日期:2013:11:07 15:19:45