How to get the program code "version code" and "model code"
I'm not sure if this is what you are asking for, but I wrote this private method the other day for my application.
- (NSDictionary*)_getClientDeviceInfo
{
UIDevice* currentDevice = [UIDevice currentDevice];
//version
NSString* sysVersion = [currentDevice systemVersion];
//model
NSString* model = [currentDevice model];
//platform
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *machine = malloc(size);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding];
free(machine);
NSDictionary *clientDeviceInfo = @{@"systemVersion":sysVersion, @"model":model, @"platform":platform};
return clientDeviceInfo;
}