iOS开发技巧之:获取iOS项目名称及版本号

    NSString *executableFile = [[[ NSBundle mainBundle ] infoDictionary ] objectForKey :( NSString *) kCFBundleExecutableKey ];    // 获取项目名称
   
   
NSString *version = [[[ NSBundle mainBundle ] infoDictionary ] objectForKey :( NSString *) kCFBundleVersionKey ];      // 获取项目版本号
   
   
   
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"];

你可能感兴趣的:(iOS,Version,版本,获取)