常见的程序的属性获取(版本号,bundle id 等)
2015-07-31 09:05
381 查看
NSString *deviceID = [UIDevice currentDevice] uniqueIdentifier];//设备id
// NSString *deviceID = [UIApplication sharedApplication] uuid];
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:@"CFBundleVersion"];//获取Bundle Version
NSDictionary *userInfo = [NSDictionary alloc] initWithObjectsAndKeys:
deviceID, @"deviceID",
systemVersion, @"systemVersion",
systemModel, @"systemModel",
appName, @"appName",
appVersion, @"appVersion",nil];
// NSString *deviceID = [UIApplication sharedApplication] uuid];
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:@"CFBundleVersion"];//获取Bundle Version
NSDictionary *userInfo = [NSDictionary alloc] initWithObjectsAndKeys:
deviceID, @"deviceID",
systemVersion, @"systemVersion",
systemModel, @"systemModel",
appName, @"appName",
appVersion, @"appVersion",nil];
相关文章推荐
- jQuery缓存数据——仿Map
- It’s Never Too Early to Think About Performance
- One Line of Working Code Is Worth 500 of Specification
- 2019 数列有序!
- JS特效实现图片自动播放并可控的效果
- 嵌入式环境下的算法开发之学习建议
- Hdu 1950 bridging signals
- Quantify
- #每日Linux小练习#01 select命令的使用
- poj 3468 A Simple Problem with Integers
- 初始MVC
- 源码推荐(7.31):RENCache(文件缓存),头像设置,汉字拼音搜索
- uva140 Bandwidth(排列树+剪枝)
- 传入一个字符串,已知字符串只由字母组成,将其中的大写字母转换为小写,小写转换为大写,返回转换后的字符串
- 最小二乘法原理及极值点判定
- 利用Java注解将常量类生成js文件供前端调用
- java中的快速排序
- 另类SEO分享:利用JS封装iframe骗过搜索引擎
- PAT (Advanced Level) 1090. Highest Price in Supply Chain (25) 供应链,BFS
- SQL WHERE IN CHARINDEX()使用