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.
As you can see there's a lot to consider when choosing your app name, so take your time and get it right. You want something unique, short, descriptive, and easy to pronounce and spell. After that you can research useful keywords and work them into your longer name, description, and keywords field.
Build Settings> Change "Product Name" TARGETS> Select app> Change "Display Name"
Go to Project -> Edit Project Settings -> Select Build tab -> look for productName in packaging category. Change it to what you want.
Try this
NSBundle *bundle = [NSBundle mainBundle]; NSDictionary *info = [bundle infoDictionary]; NSString *prodName = [info objectForKey:@"CFBundleDisplayName"];
Good answers here. I would add one thing though.
Rather than using @"CFBundleDisplayName", which has the potential to change in future, it's best to cast the string constant supplied in CFBundle.h like so:
[[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey];
Thus future-proofing your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With