1.引入头文件:



#import <sys/utsname.h>



 

2.



-(NSString *)getIphoneType{
struct utsname systemInfo;
uname(&systemInfo);
NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding];
if ([platform isEqualToString:@"iPhone4,1"]) return @"iPhone 4S";
return platform;
}