PHAsset CLLocation没有提供与照片应用相同的位置

时间:2017-02-01 12:06:24

标签: ios cllocation phasset phassetslibrary

我们使用以下方法从CLGeocoderreverseGeocodeLocation的PHAsset属性中获取纬度和经度。

CLGeocoder * geoCoder = [CLGeocoder new];
[geoCoder reverseGeocodeLocation:loc completionHandler:^(NSArray<CLPlacemark *> * _Nullable placemarks, NSError * _Nullable error) {
    CLPlacemark *placeInfo = placemarks[0];

}    

我们正在获得placeInfo对象,但是通道和subThoroughfare总是没有。

对于同一张照片,photosapp可以获取通道和subThoroughfare。

提前谢谢你。

1 个答案:

答案 0 :(得分:0)

通道和subThoroughfare属性可能不包含某些地方的数据。因此,不要使用thoroghfare和subThoroghfare创建地址字符串,而是使用addressdictionary如下:

 NSString *address = ABCreateStringWithAddressDictionary(placeInfo .addressDictionary, NO);