NSLocaleUsesMetricSystem Always YES on iPad

I am trying to decide whether the Region / Locale parameters of users will check the use of Metric values ​​(in this case, if you need to add a kilogram or a pound).

I run 3.2 on my iPad and on the simulator (Xcode 3.2.4). I tried several different region settings, but I just can't get it to return NOforNSLocaleUsesMetricSystem

NSLocale *locale = [NSLocale systemLocale]; 
BOOL usesMetric = [[locale objectForKey:NSLocaleUsesMetricSystem] boolValue];

NSLog(@"The system is Metric: %@\n", (usesMetric ? @"YES" : @"NO"));

This even happens for a language set to English , and the region is set to the United States both on the simulator and on the device itself.

I also tried NSLocaleMeasurementSystem, and it also always returns “Metric”, never “US”.

How can I decide whether to use a metric or not?

Thanks for the help :)

... May I be lucky that the whole world has changed to a metric while I was sleeping :)

+5
source share
2 answers

Try currentLocaleinsteadsystemLocale

+11
source

I have the same problem until I realized that the UK is officially using the metric system . I always thought that they still use imperial, so I tested it in the UK.

As soon as I started testing the localization of the US, the NSLocaleUsesMetricSystem started returning "NO" as expected.

Hope this helps.

+2
source

All Articles