获取项目的名称及版本号

NSString *executableFile = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleExecutableKey];


    NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey];

 

还有其它很多信息可由infoDictionary获得,以下是官方文档里的说明:

information Property List Keys
Standard keys found in a bundle’s information property list file.

const CFStringRef kCFBundleInfoDictionaryVersionKey;
const CFStringRef kCFBundleExecutableKey;
const CFStringRef kCFBundleIdentifierKey;
const CFStringRef kCFBundleVersionKey;
const CFStringRef kCFBundleDevelopmentRegionKey;
const CFStringRef kCFBundleNameKey;
const CFStringRef kCFBundleLocalizationsKey;

转载于:https://www.cnblogs.com/li-baibo/p/3406005.html

你可能感兴趣的:(获取项目的名称及版本号)