项目 获取当前版本信息
2015-11-12 10:45
155 查看
// 版本检测 // 版本信息 NSString *systemVersion = [[UIDevice currentDevice] systemVersion]; NSString *systemModel = [[UIDevice currentDevice] model]; // 是iPhone还是iPad NSDictionary *dic = [[NSBundle mainBundle] infoDictionary]; // 获取info-plist NSString *appName = [dic objectForKey:@"CFBundleIdentifier"]; // 获取Bundle identifier NSString *appVersion = [dic valueForKey:@"CFBundleIdentifier"]; // 获取Bundle Version NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys: systemVersion, @"systemVersion", systemModel, @"systemModel", appName, @"appName", appVersion, @"appVersion", nil]; NSLog(@"%@", userInfo); // 版本号 NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary]; self.version = [infoDic objectForKey:(id)kCFBundleVersionKey]; NSLog(@"heheh%@", self.version);
相关文章推荐
- oracle数据库注入实战
- Struts2前准备(MyEclipse)
- Oracle中数据库与实例的区别
- JavaBean--实例:注册验证
- (纪录片)数学的故事 The Story of Maths (2008)
- VirtualBox下安装linux虚拟机固定host-only的ip不可用
- static在C中的作用
- Spark自定义分区(Partitioner)
- POJ 2449 A* K短路
- 10段代码打通js学习的任督二脉
- IOS系统定位基础使用
- MFC总结(11) ---- 添加/删除 开机启动项
- 程序员面试切忌的10大错误
- Android 如何优雅的获取屏幕的高度和宽度
- 判断有没有安装flash
- oracle 索引移动到不同的分区
- DBCP连接池
- Java学习笔记(十五)网络编程及常用类库
- shiro+springmvc+mybatis
- jquery开发自定义的插件总结