2011년 3월 16일 수요일

[Iphone]디바이스 모델 얻어오기 및 각종 정보 얻어오기

+ (NSString *)getDeviceModel {
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];

free(machine);
return platform;
}

+ (NSString *)getOsName {
return [[UIDevice currentDevice] systemName];
}

+ (NSString *)getOsVersion {
return [[UIDevice currentDevice] systemVersion];
}

댓글 없음:

댓글 쓰기