AppleLanguages ​​no longer returns all languages

on iOS7 [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]

gave me an array of all languages. as of iOS8 this seems to have changed to installed keyboards.

how can i get an array of all languages ​​in iOS8?

+3


source to share


1 answer


Use +[NSLocale preferredLanguages]

NSUserDefaults instead of request. Please note that as mentioned in the Xcode 6.1 release notes there is a known bug while running the iOS 8.1 simulator that prevents it from working there, but this will work as expected in other versions of the simulator and on the device.



If you want a list of all supported languages, not just the user's preferred ones, you can use +[NSLocale availableLocaleIdentifiers]

that will return an NSArray of all supported locale IDs.

0


source







All Articles