刚开始在 IOS11 上工作,将我的代码从 IOS10.3 移动到 IOS11 导致了以下挑战,而以下代码在 IOS11 之前可以工作:
CLGeocoder *GeoCoder = [[CLGeocoder alloc] init];
[GeoCoder reverseGeocodeLocation:_LocationManager.location completionHandler:^(NSArray *PlaceMarks, NSError *Error)
{
if (!Error)
{
MKPlacemark *PlaceMark_MK;
if (PlaceMarks.count > 0)
{
MKPlacemark *PlaceMark = [PlaceMarks objectAtIndex:0];
if (PlaceMark.location.coordinate.latitude != 0.0F && PlaceMark.location.coordinate.longitude != 0.0F)
{
PlaceMark_MK = [[MKPlacemark alloc] initWithCoordinate:PlaceMark.location.coordinate addressDictionary:PlaceMark.addressDictionary];
……
现在使用 IOS11,它抱怨 PlaceMark.addressDictionary,而 addressDictionary 已被弃用。
addressDictionary' 已弃用:首先在 iOS 11.0 中弃用 - 使用 @properties
我试图这样做,但不幸的是,InitWithCoordinate 函数无论如何都需要 AddressDictionary。
我想知道有没有人有同样的问题,我知道它很新(IOS11昨天刚出)。