获取 版本号

[NSBundle mainBundle].infoDictionary[@"CFBundleShortVersionString"];

这个 读取获取 版本号_第1张图片

[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];

 

    // app名称

    NSString *app_Name1 = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];

    

    NSString *app_Name = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]];

    

    NSString *app_Name2 = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleExecutableKey]];

    

    NSLog(@"==============1%@-----%@---%@",app_Name1,app_Name,app_Name2);

    

    // app版本

    

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

    

    NSString *app_Version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];

    NSLog(@"==============1%@---%@",app_Version1,app_Version);

    

    // app build版本

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

    

    NSString *app_build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

    NSLog(@"==============1%@---%@",app_build1,app_build);


你可能感兴趣的:(获取 版本号)