//获取应用名称
+ (NSString*)getAppName
{
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *appName = [bundle objectForInfoDictionaryKey:@"CFBundleDisplayName"];
if (!appName) {
appName = [bundle objectForInfoDictionaryKey:@"CFBundleName"];
}
return appName;
}
//版本号
+ (NSString*)getVersion
{
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
NSString *versionNum = [bundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
return versionNum;
}
iOS开发 获取应用名称和版本号
最新推荐文章于 2020-11-27 11:14:15 发布