如何判断 ios设备的类型(iphone,ipod,ipad)

如何判断 ios设备的类型(iphone,ipod,ipad),第1张

概述功能函数: [cpp]  view plain copy -(bool)checkDevice:(NSString*)name   {       NSString* deviceType = [UIDevice currentDevice].model;       NSLog(@"deviceType = %@", deviceType);              NSRange range

功能函数:

[cpp]  view plain copy -(bool)checkDevice:(Nsstring*)name   {       Nsstring* deviceType = [UIDevice currentDevice].model;       NSLog(@"deviceType = %@", deviceType);              NSRange range = [deviceType rangeOfString:name];       return range.location != NSNotFound;   }    

 

调用:

Nsstring *  nsstrIphone=@"iPhone";   Nsstring *  nsstrIpod=@"iPod";   Nsstring *  nsstrIpad=@"iPad";   bool  bIsiPhone=false;   bool  bIsiPod=false;   bool  bIsiPad=false;   bIsiPhone=[self  checkDevice:nsstrIphone];   bIsiPod=[self checkDevice:nsstrIpod];   bIsiPad=[self checkDevice:nsstrIpad];  



出自:http://blog.csdn.net/tangaowen/article/details/6525992​

总结

以上是内存溢出为你收集整理的如何判断 ios设备类型(iphone,ipod,ipad)全部内容,希望文章能够帮你解决如何判断 ios设备的类型(iphone,ipod,ipad)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1088876.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存