Is there a way to determine the device running an application. I want to distinguish between iPhone
and iPod Touch
, if possible.
Adding to Arash's code, I don't care for my app what model I'm using, I just want to know what kind of device, so, I can test as follows:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
NSLog(@"I'm definitely an iPad");
} else {
NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType rangeOfString:@"iPhone"].location!=NSNotFound)
{
NSLog(@"I must be an iPhone");
} else {
NSLog(@"I think I'm an iPod");
}
}