美文网首页
iOS 设备信息对应设备名称

iOS 设备信息对应设备名称

作者: iToby | 来源:发表于2019-03-12 18:50 被阅读0次

参考设备列表:https://www.theiphonewiki.com/wiki/Models

获取设备信息:

    // 需要#import "sys/utsname.h"

    struct utsname systemInfo;

    uname(&systemInfo);

    NSString *machineString = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];

根据machineString返回手机版本:

    if([machineString isEqualToString:@"iPhone8,1"])  return @"iPhone_6S";

相关文章

网友评论

      本文标题:iOS 设备信息对应设备名称

      本文链接:https://www.haomeiwen.com/subject/nptopqtx.html