views:

482

answers:

3

How can this be achieved? I would like to get the name so i can display it within an app, without having to change it in code each time i change a name, of course.

+9  A: 

Try this

    NSBundle *bundle = [NSBundle mainBundle];
    NSDictionary *info = [bundle infoDictionary];
    NSString *prodName = [info objectForKey:@"CFBundleDisplayName"];
epatel
sweetness, thanks!
Edward An
A: 

I had a problem when I localize my application name by using InfoPlist.strings, like

CFBundleDisplayName = "My Localized App Name";

I could not obtain localized application name if I use infoDictionary.

In that case I used localizedInfoDirectory like below.

NSDictionary *locinfo = [bundle localizedInfoDictionary];
tokentoken
A: 

Thanks. OR you can use the direct approach,

in .h file,
IBOutlet UILabel *lableAppName;

labelAppName.text = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];

karim