iOS获取应用名、版本号、build号、Bundle Id

获取infoDictionary中某个key对应的值的方法

[[[NSBundle mainBundle] infoDictionary] valueForKey:@"key"];
或
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"key"];

应用名

[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];

版本号

[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];

build号

[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

Bundle Id

[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"];

版权声明:出自MajorLMJ技术博客的原创作品 ,转载时必须注明出处及相应链接!

你可能感兴趣的:(iOS获取应用名、版本号、build号、Bundle Id)