美文网首页iOS知识
iOS 有关手机信息的查询

iOS 有关手机信息的查询

作者: CoderKevinChan | 来源:发表于2018-04-18 16:05 被阅读0次

在开发中有项目需求,我们会用到手机相关的一些信息

1.手机系统版本:

CGFloat version = [[[UIDevice currentDevice] systemVersion ] floatValue];

2.获取UUID

NSString *identifierStr = [[[UIDevice currentDevice] identifierForVendor] UUIDString];  

3. 当前应用软件版本  比如:1.0.1  

NSString *appCurVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 

4.手机物理尺寸

CGRect rect = [[UIScreen mainScreen] bounds];  

CGSize size = rect.size;  

CGFloat width = size.width;  

CGFloat height = size.height;  

NSLog(@"物理尺寸:%.0f × %.0f",width,height); 

5.手机分辨率

CGFloat scale_screen = [UIScreen mainScreen].scale;  

NSLog(@"分辨率是:%.0f × %.0f",width*scale_screen ,height*scale_screen);  

相关文章

网友评论

    本文标题:iOS 有关手机信息的查询

    本文链接:https://www.haomeiwen.com/subject/hvgvkftx.html