关于iOS设备参数的获取

来源:互联网 发布:让wow.js兼容ie8 编辑:程序博客网 时间:2024/06/07 23:09
一、判别当前手机系统版本号
//系统版本字符串CGFloat currentSystemVersion = [[[UIDevice  currentDevice] systemVersion] floatValue];     NSLog(@"currentSystemVersion:%f",currentSystemVersion);    //currentSystemVersion:10.20000
二、获取当前手机系统名称
    //系统版本    NSString *currentSystemName = [[UIDevice currentDevice] systemName];           NSLog(@"currentSystemName:%@",currentSystemName);    //currentSystemName:iOS

三、获取设备类型

    NSString* deviceModel = [[UIDevice currentDevice] model];    if([deviceModel isEqualToString:@"iPhone"]) {        //iPhone    }    else if([deviceModel isEqualToString:@"iPod touch"]) {        //iPod Touch    }    else {        //iPad    }    NSLog(@"deviceModel is:%@",deviceModel);
0 0
原创粉丝点击