-(bool)checkDevice:(NSString*)name
{
NSString* deviceType = [UIDevice currentDevice].model;
NSLog(@"deviceType = %@", deviceType);
NSRange range = [deviceType rangeOfString:name];
return range.location != NSNotFound;
}
NSString * [email protected]"iPhone";
NSString * [email protected]"iPod";
NSString * [email protected]"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/huang2009303513/article/details/37902237