【问题标题】:PHAsset CLLocation is not giving location same as photos appPHAsset CLLocation 未提供与照片应用相同的位置
【发布时间】:2017-02-01 12:06:23
【问题描述】:

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

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

}    

我们正在获取 placeInfo 对象,但通道和 subThoroughfare 总是为零。

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

提前谢谢你。

【问题讨论】:

    标签: ios cllocation phasset phassetslibrary


    【解决方案1】:

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

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

    【讨论】:

    • 我已经尝试使用 placeInfo .addressDictionary 但它也返回相同的地方,我无法在其中获得通道和 subThoroughfare 值,但 iOS 照片应用程序如何设法获得它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-03
    • 1970-01-01
    • 2017-01-10
    • 2010-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多