我们使用以下方法从CLGeocoder
到reverseGeocodeLocation
的PHAsset属性中获取纬度和经度。
CLGeocoder * geoCoder = [CLGeocoder new];
[geoCoder reverseGeocodeLocation:loc completionHandler:^(NSArray<CLPlacemark *> * _Nullable placemarks, NSError * _Nullable error) {
CLPlacemark *placeInfo = placemarks[0];
}
我们正在获得placeInfo对象,但是通道和subThoroughfare总是没有。
对于同一张照片,photosapp可以获取通道和subThoroughfare。
提前谢谢你。
答案 0 :(得分:0)
通道和subThoroughfare属性可能不包含某些地方的数据。因此,不要使用thoroghfare和subThoroghfare创建地址字符串,而是使用addressdictionary如下:
NSString *address = ABCreateStringWithAddressDictionary(placeInfo .addressDictionary, NO);