IOS反地理编码取得城市名称

 // 获取当前所在的城市名
        CLGeocoder *reverseGeocoder=[[CLGeocoder alloc]  init];
        [reverseGeocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *array, NSError *error)
         {
             CLPlacemark *placeMark = [array lastObject];
             if (placeMark != nil)
             {
                 NSString *CityName = [placeMark.addressDictionary objectForKey:@"City"];
                 NSLog(@"城市名:%@",userCityName);
             }
             
         }];

 

posted @ 2014-02-28 17:44  菜鸟程序猿  阅读(1524)  评论(0编辑  收藏  举报