If the application name under the icon on the home screen is \"My Awesome App\" how do you get that string within the application at runtime?
Just because I love the Xcode 4.5 new way to get an array item. :)
- (NSString*)project_getAppName {
return NSBundle.mainBundle.infoDictionary[@"CFBundleDisplayName"];
}
I’d try
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
although presumably you know your own app’s name and can just use it…
Swift 3/4
let appName = Bundle.main.object(forInfoDictionaryKey: kCFBundleNameKey as String) as? String
NSString* applicationName = [entry objectForKey:(id)kCGWindowOwnerName];
Here is a good post with examples of what you are looking for. The OP didn't accept anything, which is unfortunate, but the answers are useful.