LoginSignup
5
6

More than 5 years have passed since last update.

ローカライズしたBundle display nameの取得

Posted at

Bundle display nameをプログラム中で使おうと思って、

[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];

と書いたら、なぜか英語名(というか*-Info.plistで設定しているBundle display name)になってしまったので調べてみたら、infoDictionaryではなくてlocalizedInfoDictionaryを使わないといけないらしい。

ということで、正しくは、

[[[NSBundle mainBundle] localizedInfoDictionary] objectForKey:@"CFBundleDisplayName"];

なんでlocalizedを意識せにゃならんのだ。

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6