3

How can I get city name and country name from timezone? For example, I can see all knownTimeZoneNames array, and I want to show in labels "Europe/Moscow" as "Moscow, Russia" in few languages. How can I get this strings? Actually I need localized list, as in Clock.app in iPhone.

Ascoron
  • 49
  • 3

1 Answers1

0

You can get country name from city name like this:

first import the Core Location framework

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); 
    }
];
Alex Shesterov
  • 26,085
  • 12
  • 82
  • 103