iPhone

[objc] 디바이스가 iPhone5s인가 체크, device model

tenn 2014. 2. 24. 18:48

#import <sys/sysctl.h>


    size_t size;

    sysctlbyname("hw.machine"NULL, &size, NULL0);

    char *machine = malloc(size);

    sysctlbyname("hw.machine", machine, &size, NULL0);

    NSString *platform = [NSString stringWithUTF8String:machine];

    free(machine);

    

//iPhone5s의 경우,  platform이"iPhone6"


//angeOfString:@"iPhone6"].location != NSNotFound  <- 이렇게 체크





* iPod5th : iPod5,1

* iPhone4 : iPhone3,1

* iPhone4S : iPhone4,1

* iPhone5 : iPhone5,2

* iPhone5s : iPhone6,1