gpt4 book ai didi

ios - CLPlacemark位置也会提供地区信息,为什么?

转载 作者:行者123 更新时间:2023-12-01 18:55:00 25 4
gpt4 key购买 nike

我只需要客户最近位置的城市信息,而不需要地区。任何想法如何避免?
pm.locality返回:Budapest VII. kerület,我希望只有Budapest

func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {

CLGeocoder().reverseGeocodeLocation(locations.first as CLLocation, completionHandler: {placemarks, error in

let pm = placemarks.first as CLPlacemark

最佳答案

我希望

那就是你的问题。通过反向地理编码获得的CLPlacemark对作品进行分类的方式与其分类方式不同,而不是您期望的方式。

因此,这里的解决方案是停止期望并开始处理地标,以便获得所需的结果。例如,尝试提取地标的addressDictionary,看看是否可以更轻松地使用其分类。

另外,请尝试检查地标的其他属性。也许它的sublocality更接近您的期望。或者也许是其他 property 。

关于ios - CLPlacemark位置也会提供地区信息,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28054229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com