获得设备和系统版本号

  • 首先导入<sys/utsname.h >
"i386"    simulator

"iPod1,1"  iPod Touch

" iPhone1,1 "  iPhone

" iPhone1,2" iphone 3G

" iPhone2,1" iphone 3GS

" ipad1,1" iPad

"iPhone3,1" iphone4


struct utsname systemInfo

uname(&systemInfo);



  • 得到设备系统版本
[[UIDevice currentDevice] systemVersioin]



  • 得到设备模型 类型
[ NSString stringWithCString: systemInfo.machine encoding: NSUTF8StringEncoding ];

猜你喜欢

转载自chenyue1.iteye.com/blog/1947720