iOS 获取程序~项目app名称、版本号、build版本
来源:互联网 发布:js正方形3d立体旋转 编辑:程序博客网 时间:2024/05/22 03:28
//联系人:石虎 QQ:1224614774 昵称:嗡嘛呢叭咪哄
/**
1.图形显示
2.代码实现
3.下载 demo
*/
一、图形展示
图1:
图2:
二、代码实现
//
// ViewController.m
// 自动增减算法
//
// Created by 石虎 on 2017/9/29.
// Copyright © 2017年 石虎. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
/** 获取APP名称 */
#define APP_NAME ([[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"])
/** 程序版本号 */
#define APP_VERSION [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
/** 获取APP build版本 */
#define APP_BUILD ([[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"])
/** User-Agent */
#define APP_USER_AGENT [NSString stringWithFormat:@"石虎/%@ (%@;U;%@ %@;%@/%@)", \
APP_VERSION, DeviceModel, DeviceSystemName, DeviceVersion, DeviceLocal, DeviceLang]
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"获取APP名称 === %@,程序版本号===,%@,获取APP build版本==,%@",APP_NAME,APP_VERSION,APP_BUILD);
}
@end
三、打印结果
打印: 2017-10-0915:05:03.296 自动增减算法[44032:2027891] 获取APP名称 === shihu ,程序版本号===,1.0.2,获取APP build版本==,12345
四、下载 demo 链接
请联系本人,代码会发布在 GitHub 或者是码云上;
谢谢!!!
- iOS 获取程序~项目app名称、版本号、build版本
- 73.获取iOS项目名称及版本号 Build版本
- iOS 获取app版本号、序列号、名称、、、
- 获取iOS项目名称及版本号
- 获取ios项目名称及版本号
- 获取iOS项目名称及版本号
- 获取iOS项目名称及版本号
- 获取版本号 版本名称
- Android获取App的版本名称和版本号
- 《android 获取当前app的版本号和版本名称》
- iOS获取当前app的名称和版本号
- iOS获取当前app的名称和版本号
- [iOS] 获取当前app的名称和版本号
- iOS获取当前app的名称和版本号
- iOS获取当前app的名称和版本号
- iOS获取当前app的名称和版本号
- iOS 获取当前app的名称和版本号
- iOS获取当前app的名称和版本号 配置属性
- maven多模块使用,父模块(modules使用,package替pom),子模块(parent使用)
- SpringMVC 之 @ModelAttribute&OOP处理
- 纯虚函数和抽象基类的使用
- Vim 权限不足时 强制保存只读类型文件的方法
- c语言模拟实现strcpy
- iOS 获取程序~项目app名称、版本号、build版本
- CodeForces Gym101147F Bishops Alliance
- 【设计模式】前端控制器模式(Front Controller Pattern)
- HTTP与HTTPS的区别
- Vue.js插件axios——封装一个可以灵活使用的ajax
- SLA小组学习收获
- 关于深度学习优化器 optimizer 的选择,你需要了解这些
- spring,springmvc,mybatis,AJAX集成+alibaba的连接池druid
- 【教程】PDF控件Spire.PDF 教程:在C#中加密和解密PDF文件