ios - 从图像Objective c中提取经纬度
<p><p>我在从图像(包含地理位置详细信息)获取纬度和经度数据时遇到问题。我已经导入了 EXIF 框架,我正在使用以下代码来实现这一点:</p>
<pre><code> NSData *jpegData = ;
EXFJpeg* jpegScanner = [ init];
;
EXFMetaData* exifData = jpegScanner.exifMetaData;
id latitudeValue = ];
id longitudeValue = ];
NSLog(@"Longitude: %@Longitude: %@", latitudeValue, longitudeValue);
</code></pre>
<p>但是它返回纬度和经度的 NULL 值,谁能告诉我我在上面的代码中做错了什么?请帮帮我。提前致谢!!</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您可以使用 <a href="https://stackoverflow.com/questions/tagged/alasset" class="post-tag" title="show questions tagged 'alasset'" rel="noreferrer noopener nofollow">alasset</a>框架。</p>
<pre><code>ALAssetsLibrary *assetsLibrary = [init];
;
ALAssetsLibraryAssetForURLResultBlock resultBlock = ^(ALAsset *photoAsset) {
CLLocation *location = ;
NSMutableDictionary *exifDataDict = [ init];
if (location != nil) {
forKey:@"latitude"];
forKey:@"longitude"];
}
}
</code></pre></p>
<p style="font-size: 20px;">关于ios - 从图像Objective c中提取经纬度,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/18018244/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/18018244/
</a>
</p>
页:
[1]