iOS设备信息的获取
来源:互联网 发布:sql 格式化字符串 编辑:程序博客网 时间:2024/05/21 09:44
方法1:
+ (NSString*)getDeviceVer{ size_t size; sysctlbyname("hw.machine", NULL, &size, NULL, 0); char *machine = (char*)malloc(size); sysctlbyname("hw.machine", machine, &size, NULL, 0); NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding]; free(machine); return platform;}
方法2:
struct utsname systemInfo;uname(&systemInfo);NSString *deviceString = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];方法3:只能获取iPhone还是iPad 无法获取型号
[[UIDevice currentDevice]model]
获取设备操作系统信息
获取手机信息的方法:UIDevice NSBundle
UIDevice: [UIDevice currentDevice]
Name 设备名称
identifierForVendor UUID
systemName 系统名称
systemVersion系统版本号
model 设备模式(iphone ipod touch)
localizeModel 本地设备模式
NSBundle:
[[NSBundle mainBundle] infoDictionary]
可以获取plist中的信息:应用ID 名称 应用版本 渠道 系统版本 等
获取系统分辨率
+(NSString*)getScreen{ CGRect rect_screen = [[UIScreen mainScreen] bounds]; CGFloat rect_scale = [UIScreen mainScreen].scale; CGFloat width = rect_scale*rect_screen.size.width; CGFloat height = rect_scale*rect_screen.size.height; return [NSString stringWithFormat:@"%.0fx%.0f",width,height];}获取网络类型
0 0
- IOS 获取设备的信息
- iOS设备信息的获取
- 获取iOS设备的信息
- 获取ios设备信息
- ios 获取设备信息
- 获取iOS设备信息
- IOS获取设备信息
- iOS获取设备信息
- 获取iOS设备信息
- 获取iOS设备信息
- iOS 设备信息获取
- iOS 获取设备信息
- iOS 获取设备信息
- iOS获取设备信息
- ios获取设备信息
- 获取iOS设备信息
- ios获取设备信息
- iOS 获取设备信息
- haproxy控制下的灰度发布策略
- 彩色图转灰度图
- inivis ac3d(3d模型设计软件)
- PKCS#7格式数字签名验证
- (error) LOADING Redis is loading the dataset in memory问题解决
- iOS设备信息的获取
- 附录_字符集问题
- Versions(莲花) 1.3.3破解
- Spark Job (thrift-server) 动态分配资源
- Myeclipse设置注释模板
- 第十章 数组与指针 p248
- (三)、配置 SecureCRT、SSH 及 ShadowSocks
- java的拼音处理
- [Zjoi2013]K大数查询