#include <sys/types.h> #include <sys/sysctl.h> - (NSString *)machineInfo { NSString *device; size_t size; sysctlbyname("hw.machine", NULL, &size, NULL, 0); char *name = malloc(size); sysctlbyname("hw.machine", name, &size, NULL, 0); device = [NSString stringWithUTF8String:name]; free(name); return device; }
Comments
Post a Comment