获取项目名称
NSString *executableFile = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleExecutableKey];
版本号
NSString *bulid = [[[NSBundlemainBundle] infoDictionary]objectForKey:(NSString *)kCFBundleVersionKey];
以上方法不能得到 app_Version 只能通过下面方法
或者下面方法
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
CFShow(infoDictionary);
// app名称
NSString *app_Name = [infoDictionary objectForKey:@
"CFBundleDisplayName"
];
// app版本
NSString *app_Version = [infoDictionary objectForKey:@
"CFBundleShortVersionString"
];
// app build版本
NSString *app_build = [infoDictionary objectForKey:@
"CFBundleVersion"
];
最快速则为这样
[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleDisplayName"]
[[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]
[[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleVersion"]