"Get Device Model"

Wed 09 January 2013
+ (NSString *)getDeviceModel {
    size_t size;
    char *model = malloc(size);
    sysctlbyname("hw.machine", model, &size, NULL, 0);
    NSString *sDeviceModel = [NSString stringWithCString:model encoding:NSUTF8StringEncoding];
    free(model);
    NSUInteger len = [sDeviceModel length];
    return [sDeviceModel substringToIndex:len - 2];
}