[Solved] Determining the type of an iOS device in Xcode [duplicate]
– (NSString *) IphoneModel { size_t size; sysctlbyname(“hw.machine”, NULL, &size, NULL, 0); char *machine = (char*)malloc(size); sysctlbyname(“hw.machine”, machine, &size, NULL, 0); NSString *platform = [NSString stringWithCString:machine encoding: NSUTF8StringEncoding]; free(machine); if ([platform isEqualToString:@”iPhone1,1″]) return @”iPhone 1G”; if ([platform isEqualToString:@”iPhone1,2″]) return @”iPhone 3G”; if ([platform isEqualToString:@”iPhone2,1″]) return @”iPhone 3GS”; if ([platform isEqualToString:@”iPhone3,1″]) return @”iPhone 4″; if ([platform … Read more