struct utsname systemInfo; uname(&systemInfo); NSString *platform = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding]; // 常用机型 不需要的可自行删除 if([platform isEqualToString:@"iPhone5,1"]) self.mt = @"iPhone5"; if([platform isEqualToString:@"iPhone5,2"]) self.mt = @"iPhone5"; if([platform isEqualToString:@"iPhone5,3"]) self.mt = @"iPhone5c"; if([platform isEqualToString:@"iPhone5,4"]) self.mt = @"iPhone5c"; if([platform isEqualToString:@"iPhone6,1"]) self.mt = @"iPhone5s"; if([platform isEqualToString:@"iPhone6,2"]) self.mt = @"iPhone5s"; if([platform isEqualToString:@"iPhone7,1"]) self.mt = @"iPhone6Plus"; if([platform isEqualToString:@"iPhone7,2"]) self.mt = @"iPhone6"; if([platform isEqualToString:@"iPhone8,1"]) self.mt = @"iPhone6s"; if([platform isEqualToString:@"iPhone8,2"]) self.mt = @"iPhone6sPlus"; if([platform isEqualToString:@"iPhone8,4"]) self.mt = @"iPhoneSE"; if([platform isEqualToString:@"iPhone9,1"]) self.mt = @"iPhone7"; if([platform isEqualToString:@"iPhone9,3"]) self.mt = @"iPhone7"; if([platform isEqualToString:@"iPhone9,2"]) self.mt = @"iPhone7Plus"; if([platform isEqualToString:@"iPhone9,4"]) self.mt = @"iPhone7Plus"; if([platform isEqualToString:@"iPhone10,1"]) self.mt = @"iPhone8"; if([platform isEqualToString:@"iPhone10,4"]) self.mt = @"iPhone8"; if([platform isEqualToString:@"iPhone10,2"]) self.mt = @"iPhone8Plus"; if([platform isEqualToString:@"iPhone10,5"]) self.mt = @"iPhone8Plus"; if([platform isEqualToString:@"iPhone10,3"]) self.mt = @"iPhoneX"; if([platform isEqualToString:@"iPhone10,6"]) self.mt = @"iPhoneX"; if([platform isEqualToString:@"iPhone11,8"]) self.mt = @"iPhoneXR"; if([platform isEqualToString:@"iPhone11,2"]) self.mt = @"iPhoneXS"; if([platform isEqualToString:@"iPhone11,4"]) self.mt = @"iPhoneXSMax"; if([platform isEqualToString:@"iPhone11,6"]) self.mt = @"iPhoneXSMax"; if([platform isEqualToString:@"iPhone12,1"])self.mt = @"iPhone 11"; if([platform isEqualToString:@"iPhone12,3"])self.mt =@"iPhone 11 Pro"; } if([platform isEqualToString:@"iPhone12,5"])self.mt = @"iPhone 11 Pro Max";