How to get localized city and country names for time zone name

How do I get the city name and country name from the time zone? For example, I can see the entire array of known TimeZoneNames, and I want to display on Europe / Moscow labels as Moscow, Russia in multiple languages. How can I get these lines? Actually I need a localized list like Clock.app on iPhone.

+3


source to share


1 answer


You can get the country name from the city name like this:

first import the infrastructure of the main location



CLGeocoder *gc = [[CLGeocoder alloc] init]; 
[gc geocodeAddressString:@"Moscow" 
    completionHandler:^(NSArray *placemarks, NSError *error) 
    { CLPlacemark *placeMark = [[CLPlacemark alloc] initWithPlacemark:(CLPlacemark *)[placemarks objectAtIndex:0]]; NSLog(@"placeMark.country: %@", placeMark.country); 
    }
];

      

+1


source







All Articles