app ios 获取版本提交
2011-11-29 15:42:49 lele9001 阅读数 3601

不解释,直接上代码



    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    NSString *name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
    NSString *version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
    NSString *build = [infoDictionary objectForKey:@"CFBundleVersion"];
    NSString *label = [NSString stringWithFormat:@"%@ v%@ (build %@)", name, version, build];
    
    NSLog(@"%@",label);


2014-06-11 12:49:57 u011140147 阅读数 610
  1. NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];  
  2. NSString *name = [infoDictionary objectForKey:@"CFBundleDisplayName"];  
  3. NSString *version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];  
  4. NSString *build = [infoDictionary objectForKey:@"CFBundleVersion"];  
  5. NSString *label = [NSString stringWithFormat:@"%@ v%@ (build %@)", name, version, build];  
  6.   
  7. NSLog(@"%@",label);  
2016-05-04 11:38:44 CZHuiGe 阅读数 293

NSLog(@"%@",[NSString stringWithFormat:@"v%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey]]  );

2015-02-09 18:16:11 u013243469 阅读数 812
//软件版本
- (void)softwareVersion
{
    NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
    NSString *currentVersion = [NSString stringWithFormat:@"当前软件版本为:%@",infoDic[@"CFBundleShortVersionString"]];
    UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"软件版本" message:currentVersion delegate:nil cancelButtonTitle:@"确定" otherButtonTitles: nil];
    [alertView show];
}

2017-09-21 11:16:52 zxri728 阅读数 1269

//获取所有信息字典

NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];

NSString *executableFile = [infoDictionary objectForKey:(NSString *)kCFBundleExecutableKey]; //获取项目名称


NSLog(@"executableFile == %@",executableFile);


NSString *version = [infoDictionary objectForKey:(NSString *)kCFBundleVersionKey]; //获取项目版本号

NSLog(@"version .. %@",version);


// app名称

NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];

NSLog(@"app_Name == %@",app_Name);


// app版本

NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];

NSLog(@"app_Version .. %@",app_Version);

// app build版本

NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"];

NSLog(@"app_build >> %@",app_build);


iOS APP新版本提交

阅读数 484

iOS获取App名称,版本

博文 来自: X_X_J_49
没有更多推荐了,返回首页