码迷,mamicode.com
首页 > 移动开发 > 详细

iOS获取设备信息

时间:2015-08-17 13:54:00      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

    NSString *strName = [[UIDevice currentDevice] name]; // Name of the phone as named by user
    
    
    NSString *strSysName = [[UIDevice currentDevice] systemName]; // "iPhone OS"
    
    NSString *strSysVersion = [[UIDevice currentDevice] systemVersion]; // "2.2.1"
    
    NSString *strModel = [[UIDevice currentDevice] model]; // "iPhone" on both devices
    
    NSString *strLocModel = [[UIDevice currentDevice] localizedModel]; // "iPhone" on both devices
    
    float version = [[[UIDevice currentDevice] systemVersion] floatValue];
    
    
    
    NSLog(@"\nstrName=%@  \nstrSysName=%@  \nstrSysVersion=%@  \nstrModel=%@  \nstrLocModel=%@  \nversion=%f",strName,strSysName,strSysVersion,strModel,strLocModel,version);


//打印结果

strName=haijie的 iPhone  
strSysName=iPhone OS  
strSysVersion=8.4  
strModel=iPhone  
strLocModel=iPhone  
version=8.400000

 

 

iOS获取设备信息

标签:

原文地址:http://www.cnblogs.com/haijieFeng/p/4736268.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!