我试图通过使用kCFBundleNameKey来获取包的短名称
NSString *shortBundleName=[[NSBundle mainBundle]
objectForInfoDictionaryKey:(NSString *) kCFBundleNameKey];
它的工作正常但是当我因某种原因有多个目标它返回null时,有没有解决方法呢?
让捆绑工作正常:
NSString * fullBundleName = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
答案 0 :(得分:0)
的CoreFoundation / CFBundle.h:
CF_EXPORT
const CFStringRef kCFBundleNameKey;
/* The human-readable name of the bundle.
This key is often found in the InfoPlist.strings
since it is usually localized. */
所以,你应该看一下你的目标info.plist