oc知道经纬度求位置

  CLLocation *newLocation = [locations lastObject];

    

    CLGeocodeCompletionHandler handler = ^(NSArray *place, NSError *error) {

        

        for (CLPlacemark *placemark in place) {

            

            NSString *cityStr=[placemark.addressDictionary objectForKey:@"City"];

            locationLab.text = cityStr;

            break;

            /*

             NSString *cityStr=[placemark.addressDictionary objectForKey:@"City"];

             

             NSLog(@”city %@”,cityStr);

             

             NSString *Street=[placemark.addressDictionary objectForKey:@"Street"];

             

             NSLog(@”Street %@”,Street);

             

             NSString *State=[placemark.addressDictionary objectForKey:@"State"];

             

             NSLog(@”State %@”,State);

             

             NSString *ZIP=[placemark.addressDictionary objectForKey:@"ZIP"];

             

             NSLog(@”ZIP %@”,ZIP);

             

             NSString *Country=[placemark.addressDictionary objectForKey:@"Country"];

             

             NSLog(@”Country %@”,Country);

             

             NSString *CountryCode=[placemark.addressDictionary objectForKey:@"CountryCode"];

             

             NSLog(@”CountryCode %@”,CountryCode);

             

             */

            

        }

        

    };

    //CLGeocoder

    [self.geocoder reverseGeocodeLocation:newLocation completionHandler:handler];

原文地址:https://www.cnblogs.com/hualuoshuijia/p/5391499.html