不推荐使用addressDictionary:首先在iOS 11.0中弃用 – 使用@properties

不推荐使用addressDictionary:首先在iOS 11.0中弃用 – 使用@properties,第1张

概述我正在努力获取地点和地址.因为我获得了成功的位置,但在获得地址的时候我得到了警告,比如 'addressDictionary' is deprecated: first deprecated in iOS 11.0 - Use @properties 对此有任何解决方案…… 在斯威夫特 if (error) == nil { var placemark = placemarks[0] as 我正在努力获取地点和地址.因为我获得了成功的位置,但在获得地址的时候我得到了警告,比如

'addressDictionary' is deprecated: first deprecated in iOS 11.0 - Use @propertIEs

对此有任何解决方案……

解决方法 在斯威夫特

if (error) == nil {    var placemark = placemarks[0] as? CLPlacemark    var address = "\(placemark?.thoroughfare ?? ""),\(placemark?.locality ?? ""),\(placemark?.subLocality ?? ""),\(placemark?.administrativeArea ?? ""),\(placemark?.postalCode ?? ""),\(placemark?.country ?? "")"        print("\(address)")}

在目标C中

if (!(error))    {        CLPlacemark *placemark = [placemarks objectAtIndex:0];            Nsstring *address = [Nsstring stringWithFormat:@"%@,%@,%@",placemark.thoroughfare,placemark.locality,placemark.subLocality,placemark.administrativeArea,placemark.postalCode,placemark.country];        NSLog(@"%@",address);    }
总结

以上是内存溢出为你收集整理的不推荐使用addressDictionary:首先在iOS 11.0中弃用 – 使用@properties全部内容,希望文章能够帮你解决不推荐使用addressDictionary:首先在iOS 11.0中弃用 – 使用@properties所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1060109.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存