Determine device (iPhone, iPod Touch) with iOS
问题 Is there a way to determine the device running an application. I want to distinguish between iPhone and iPod Touch , if possible. 回答1: You can use the UIDevice class like this: NSString *deviceType = [UIDevice currentDevice].model; if([deviceType isEqualToString:@"iPhone"]) // it's an iPhone 回答2: This is an update for UIDeviceHardware.m from the answer above. - (NSString *)platformString { NSString *platform = [self platform]; if ([platform isEqualToString:@"iPhone1,1"]) return @"iPhone 1G";