Is it possible to get the specific iPhone model number?
Possible Duplicate:
Determine device (iPhone, iPod Touch) with iPhone SDK
How to find iPhone/iPod Device model(3G,3GS,4,4S) by code?
I know there is a way to get the model and localized model of the phone by using the command [[UIDevice currentDevice] model] or [[UIDevice currentDevice] localizedModel], but on several iPhones, both commands generate the same result, which is "iPhone" (or "iPad" for all iPads).
I was hoping to find a way to detect whether the device is an iPhone 3, 3S, 4, 4S, or 5 (or iPad 1, 2, etc). Is this value hidden within the uniqueIdentifier, or is there an easier way to find this?
From this iphonedevsdk post,
#import <sys/utsname.h>
struct utsname u;
uname(&u);
NSString *nameString = [NSString stringWithCString:u.machine encoding:NSUTF8StringEncoding];
Check this blog "iPhone @2x Graphics, scale, and iPad" and this list of identifiers as well.
链接地址: http://www.djcxy.com/p/50366.html下一篇: 是否有可能获得特定的iPhone型号?