Rex*_*c66 3 iphone objective-c assetslibrary alasset
我想获取图像的时间戳,我可以得到正确的纬度和经度值,但时间戳总是返回当前时间,而不是图像的EXIF时间.
ALAssetsLibraryAssetForURLResultBlock resultsBlock = ^(ALAsset *asset) {
CLLocation *imageLoc = [asset valueForProperty:ALAssetPropertyLocation];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"dd/MM/YY HH:mm:ss"];
NSString *trailTime = [formatter stringFromDate:imageLoc.timestamp];
NSLog(@"---+++ image TimeStamp: %@", trailTime);
[formatter release];
Run Code Online (Sandbox Code Playgroud)
任何帮助表示感谢,谢谢
Dee*_*olu 13
您需要使用ALAssetPropertyDate密钥获取日期.
NSDate * date = [asset valueForProperty:ALAssetPropertyDate];
/* Use the `NSDateFormatter` instance to print the date */
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4075 次 |
| 最近记录: |