iOS获取当前app版本

2021-10-29 10:54:11 浏览数 (1)

代码语言:javascript复制
//软件版本

- (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 nil];  
    [alertView show];  
}  </pre> 

0 人点赞