日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ios 判断iPhone、iPad硬件型号

發布時間:2024/1/8 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ios 判断iPhone、iPad硬件型号 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

方法1:

#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 = [NSStringstringWithCString:machineencoding:NSUTF8StringEncoding]; ?
? ? free(machine); ?
? ? return platform; ?
}

方法2:

#import <sys/utsname.h>

NSString*machineName()

{

struct utsname systemInfo;

uname(&systemInfo);

return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];

}


逗號后面數字解釋:(i386是指模擬器)
1-WiFi版
2-GSM/WCDMA 3G版
3-CDMA版

僅供參考:

AppleTV(2G) ? ?(AppleTV2,1)
iPad ? ? ? ?? ?(iPad1,1)
iPad2,1 ? ??? ?(iPad2,1)Wifi版
iPad2,2 ? ??? ?(iPad2,2)GSM3G版
iPad2,3 ? ??? ?(iPad2,3)CDMA3G版
iPhone ? ? ?? ?(iPhone1,1)
iPhone3G ? ?? ?(iPhone1,2)
iPhone3GS ??? ?(iPhone2,1)
iPhone4 ? ??? ?(iPhone3,1)
iPhone4(vz)?? ?(iPhone3,3)iPhone4 CDMA版
iPhone4S ? ?? ?(iPhone4,1)
iPodTouch(1G) ?(iPod1,1)
iPodTouch(2G) ?(iPod2,1)
iPodTouch(3G) ?(iPod3,1)

iPodTouch(4G) ?(iPod4,1)

僅供參考:

@"i386" on the simulator

@"iPod1,1" on iPod Touch

@"iPod2,1" on iPod Touch Second Generation

@"iPod3,1" on iPod Touch Third Generation

@"iPod4,1" on iPod Touch Fourth Generation

@"iPhone1,1" on iPhone

@"iPhone1,2" on iPhone 3G

@"iPhone2,1" on iPhone 3GS

@"iPad1,1" on iPad

@"iPad2,1" on iPad 2

@"iPad3,1" on 3rd Generation iPad

@"iPhone3,1" on iPhone 4

@"iPhone4,1" on iPhone 4S

@"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada)

@"iPhone5,2" on iPhone 5 (model A1429, everything else)

@"iPad3,4" on 4th Generation iPad@"iPad2,5" on iPad Mini

@"iPhone5,3" on iPhone 5c (model A1456, A1532 | GSM)

@"iPhone5,4" on iPhone 5c (model A1507, A1516, A1526 (China), A1529 | Global)

@"iPhone6,1" on iPhone 5s (model A1433, A1533 | GSM)

@"iPhone6,2" on iPhone 5s (model A1457, A1518, A1528 (China), A1530 | Global)

@"iPad4,1" on 5th Generation iPad (iPad Air) - Wifi

@"iPad4,2" on 5th Generation iPad (iPad Air) - Cellular

@"iPad4,4" on 2nd Generation iPad Mini - Wifi

@"iPad4,5" on 2nd Generation iPad Mini - Cellular

?

PS:

附上IOS不同設備的參數URL

http://theiphonewiki.com/wiki/IPhone
http://theiphonewiki.com/wiki/IPod_touch
http://theiphonewiki.com/wiki/IPad

總結

以上是生活随笔為你收集整理的ios 判断iPhone、iPad硬件型号的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。