Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why has Xcode 6.1 killed [NSLocale preferredLanguages] in IOS 8 simulators

Tags:

xcode6

Yesterday Xcode updated to v6.1.

Now, [NSLocale preferredLanguages] is returning an empty array in the iPhone, but only for IOS 8 - both in iPhone 5 and 6 emulators. IOS 7 simulators are still working fine.

A physical iPhone 6 device doesn't appear to be affected - it's just the simulators.

The usual attempts - clean project, restart Xcode, reboot Mac - have made no difference. So, what's the best strategy - wait for Xcode 6.1.1, or send a complaint to an Apple list (which one) ?

like image 570
Bill Avatar asked Mar 18 '23 02:03

Bill


1 Answers

You can use category with currentLocale method swizzling as described in here. The category allows one to override in general language and region settings in the project for all targets at once.

Also you can use scheme settings for each target in separate way. If you have many localizations in your app,

enter image description here

you can change Application language and Application region in scheme settings for each target. You can even make a separate target for each localization for faster language tests.

Product -> Scheme -> Edit scheme...

enter image description here

like image 57
malex Avatar answered Apr 26 '23 05:04

malex