Swift NSLocale Simulator iOS 8

I have a problem with Swift and iOS 8 Emulator in Xcode 6.1.

Indeed, when I try to use NSLocale, almost all of its functions return nil.

Here is how I use it:

let cc = "fr" // Example let locale = NSLocale.currentLocale() let countryName = locale.displayNameForKey(NSLocaleCountryCode, value : cc) println(countryName) // Shows : nil 

It works on devices, iOS 7 and iOS 8 and on the iOS 7 simulator. It does not work on the iOS 8 simulator and on the Playground, it is even EXC_BAD_ACCESS. I assume this is just a simulator and a problem with the playground, but this is weird. And I want to know if anyone has a workaround.

I cleared the received data, restarted and cleared the simulator data. Not better.

+1
xcode ios8 swift nslocale
Oct 28 '14 at 8:30
source share
1 answer

Known issue described in the Xcode 6.1 release notes :

In some situations, [NSLocale currentLocale] may return en_US instead of the selected locale in the iOS 8.1 simulator. (18512161

+3
Oct 28 '14 at 8:37
source share



All Articles