-
iOS 및 Platform의 구분 체크iPhone 2010. 10. 25. 15:01
#include <sys/sysctl.h>
+ (NSString *) 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 stringWithUTF8String:machine];
free(machine);
return platform;
}
※ Return Value
Possible values:
"i386" = iPhone Simulator
"iPhone1,1" = iPhone 1G
"iPhone1,2" = iPhone 3G
"iPhone2,1" = iPhone 3GS
"iPhone3,1" = iPhone 4
"iPod1,1" = iPod touch 1G
"iPod2,1" = iPod touch 2G
"iPod3,1" = iPod touch 3G'iPhone' 카테고리의 다른 글
Easy APNS (0) 2010.12.10 iPhone App - iAD 적용 (0) 2010.10.21 [xcode] iOS iphone memory check (0) 2010.09.30 Objective-C for iPhone Developers: A Beginner's Guide. (0) 2010.08.25 iPhone SDK: A Beginner's Guide (0) 2010.08.25