views:

159

answers:

1

Hi

During the localization of my app I went through a lot of documentation, somewhere Im sure I read that there is a way to get a set of units that is linked with the locale.

I believe it said something like "units based on cultural..." something.

I would like to display temperature and distance in Fahrenheit and Miles for some countries and Celsius and Kilometers for other countries.

Is there a way to access a list of these units in the iPhone SDK.

Thanks you.

+1  A: 

You can use NSLocale to check the currency unit, but for imperial vs. metric you need to make a list yourself.

Oops. You can check for the imperial vs. metric. There is are NSLocaleMeasurementSystem and NSLocaleUsesMetricSystem keys.

KennyTM
Hi KennyThank You! Guess I'll give it some more thought to as if it can be justified loading such a list for two small labels :/
RickiG
@RickiG. Sorry. check update.
KennyTM
Hi Kenny! Thanks for getting back on this one:) just perfect, I had not yet begun compiling a list of countries vs. measurement system so this came at a perfect time. Thanks again.
RickiG
It is actual as simple as: BOOL isMetric = [[[NSLocale currentLocale] objectForKey:NSLocaleUsesMetricSystem] boolValue];
RickiG