Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
デバイスの現在のロケールを簡単に取得できることはわかっていますが、私の場合、ユーザーは UIPickerView から言語を選択します。各言語は配列内の文字列であり、電話機のデバイス言語設定の設定とまったく同じ方法で入力されます。
@"English" や @"Arabic" のような文字列から言語の略語を取得することは可能ですか?
ありがとう!
NSLocale+canonicalLocaleIdentifierFromString:はこの翻訳を行います。
NSLocale
+canonicalLocaleIdentifierFromString: