[ios] Fixed crash on launch in iosapp

Use NSLocaleLanguageCode instead of -[NSLocale languageCode], which is newer than the minimum deployment target.
This commit is contained in:
Minh Nguyễn
2016-12-13 02:42:56 -08:00
committed by Minh Nguyễn
parent 9f4dd1c5f4
commit 2d52dd8c0f

View File

@@ -1210,7 +1210,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
NSString *bestLanguage;
for (NSString *language in preferredLanguages) {
NSString *thisLanguage = [NSLocale localeWithLocaleIdentifier:language].languageCode;
NSString *thisLanguage = [[NSLocale localeWithLocaleIdentifier:language] objectForKey:NSLocaleLanguageCode];
if ([supportedLanguages containsObject:thisLanguage]) {
bestLanguage = thisLanguage;
break;