Rob Bonner
Rob Bonner

Reputation: 9424

Get target name (or icon name) in my code

Have been searching for this, I need to have a conditional statement in my objective C code based on the target, but I can't seem to find a direct way to get the target name from the code.

Have been trying to read the icon value from the bundle using:

NSLog(@"Icon File: %@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"icon"]);

which always return null.

Looking for a suggestion.

Thanks in advance!

Upvotes: 0

Views: 1557

Answers (1)

Aloha Silver
Aloha Silver

Reputation: 1394

Try

NSLog(@"Icon File: %@",[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]);

That should give you the name that is displayed under the icon.

Upvotes: 3

Related Questions