tags:

views:

19

answers:

1

Hello all,

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!

+1  A: 

Try

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

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

Aloha Silver
Perfect, thank you!
Rob Bonner