功能函数:
[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)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)