0

I've been trying to fetch the application name's from the bundles ID's (e.g com.apple.mobilesafari) I have stored into an array. I have tried using the code bellow but I get a null output for the appName output due to the line of code I am using to retrieve the appName obviously isn't working.

for (NSString *str in valididentifiers){
NSString *appName = [[NSBundle bundleWithIdentifier:str] objectForInfoDictionaryKey:(id)kCFBundleExecutableKey];

NSLog(@"AppName: %@",appName);
}

I have also tried the code with setting the bundle ID manually (for testing purposes) and found a similar null result when I should of seen MobileSafari as the app name. Here is my code for that...

NSString *appName = [[NSBundle bundleWithIdentifier:@"com.apple.mobilesafari"] objectForInfoDictionaryKey:(id)kCFBundleExecutableKey];
NSLog(@"AppName: %@",appName);

NSLog Output For Both Occassions:

2017-07-19 19:47:28.362: AppName: (null)

So I don't know if I am going about this the wrong way or made some sort of mistake, but any help would be greatly appreciated.

Tom
  • 3
  • 2
  • https://stackoverflow.com/questions/14023618/get-app-name-from-bundle-id – GIJOW Jul 19 '17 at 19:07
  • Possible duplicate of [Get app name from bundle id](https://stackoverflow.com/questions/14023618/get-app-name-from-bundle-id) – dirtydanee Jul 19 '17 at 19:38

0 Answers0