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

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

时间:2014-07-18 16:37:54      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:os   io   re   c   type   ios   

-(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];


如何判断 ios设备的类型(iphone,ipod,ipad),布布扣,bubuko.com

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

标签:os   io   re   c   type   ios   

原文地址:http://blog.csdn.net/huang2009303513/article/details/37902237

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