Reputation: 9424
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
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