您好,欢迎来到知库网。
搜索
您的当前位置:首页获取设备类型及系统版本

获取设备类型及系统版本

来源:知库网

import "sys/utsname.h"

/*!

  • get the information of the device and system
  • "i386" simulator
  • "iPod1,1" iPod Touch
  • "iPhone1,1" iPhone
  • "iPhone1,2" iPhone 3G
  • "iPhone2,1" iPhone 3GS
  • "iPad1,1" iPad
  • "iPhone3,1" iPhone 4
  • @return null
    */
    —(void)getDeviceAndOSInfo
    {
    //here use sys/utsname.h
    struct utsname systemInfo;
    uname(&systemInfo);
    //get the device model and the system version
    NSLog(@"%@", [NSString encoding:NSUTF8StringEncoding]);
    NSLog(@"%@", [[UIDevice currentDevice] systemVersion]);
    }

Copyright © 2019- zicool.com 版权所有 湘ICP备2023022495号-2

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务