2011-09-29 4 views

답변

5

당신은 기능 (credits)와 모델 ID를 검사 할 수 있습니다

#include <sys/types.h> 
#include <sys/sysctl.h> 
NSString* machine() { 
     size_t size; 

      // Set 'oldp' parameter to NULL to get the size of the data 
      // returned so we can allocate appropriate amount of space 
     sysctlbyname("hw.machine", NULL, &size, NULL, 0); 

      // Allocate the space to store name 
     char *name = malloc(size); 

      // Get the platform name 
     sysctlbyname("hw.machine", name, &size, NULL, 0); 

      // Place name into a string 
     NSString *machineid = [NSString stringWithUTF8String:name]; 

      // Done with this 
     free(name); 

     return machineid; 
    } 

기능은 아이폰 4 (CDMA/버라이존)의 약자 @ "iPhone3,3"와 같은 문자열을 반환합니다. 다양한 모델 번호의 전체 테이블을 수집하는 것이 어려울 수 있습니다. 일부 모델 설명은 here입니다. 새 모델이 나타나면 모델 테이블을 확장해야합니다.

관련 문제