如何从reverseGeocodeLocation本地化地址结果?

我的iPhone应用程序应该根据用户的经纬度来parsing地址。 reverseGeocodeLocation工作正常,但结果是英文。

有没有办法将结果本地化到其他语言?

在苹果或其他任何地方找不到关于它的任何信息。

我使用的代码是:

CLGeocoder *geocoder = [[[CLGeocoder alloc] init] autorelease]; CLLocation *location = [[[CLLocation alloc] initWithLatitude:coord.latitude longitude:coord.longitude] autorelease]; [geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) { NSLog(@"reverseGeocodeLocation:completionHandler: Completion Handler called!"); if (error){ NSLog(@"Geocode failed with error: %@", error); [self displayError:error]; return; } if(placemarks && placemarks.count > 0) { //do something CLPlacemark *topResult = [placemarks objectAtIndex:0]; NSString *addressTxt = [NSString stringWithFormat:@"%@ %@,%@ %@", [topResult subThoroughfare],[topResult thoroughfare], [topResult locality], [topResult administrativeArea]]; } } 

我发现如何本地化国名,也许会有所帮助:

 CLPlacemark *placemark; NSString *identifier = [NSLocale localeIdentifierFromComponents: [NSDictionary dictionaryWithObject: placemark.ISOcountryCode forKey: NSLocaleCountryCode]]; NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; NSString *country = [usLocale displayNameForKey: NSLocaleIdentifier value: identifier]; 

插入任何国家ID代替@“en_US”

Mattt Thompson对使用AddressBookUI.framework中的方法在他的网站NSHipster上进行地址本地化有一个很好的写法 。 他还在github上有一个格式化库 ,其中包含一个使用他描述的AddressBookUI.framework方法进行这种本地化的类。