博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mac 下获取 os x 的系统版本,使用 oc cocoa
阅读量:6804 次
发布时间:2019-06-26

本文共 601 字,大约阅读时间需要 2 分钟。

mac 下获取 os x 的系统版本,使用 oc cocoa

1:

#import 
SInt32 major, minor, bugfix;Gestalt(gestaltSystemVersionMajor, &major);Gestalt(gestaltSystemVersionMinor, &minor);Gestalt(gestaltSystemVersionBugFix, &bugfix);NSString *systemVersion = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix];

 

2:

NSDictionary *systemVersionDictionary =    [NSDictionary dictionaryWithContentsOfFile:        @"/System/Library/CoreServices/SystemVersion.plist"];NSString *systemVersion =    [systemVersionDictionary objectForKey:@"ProductVersion"];

 

参考:

转载于:https://www.cnblogs.com/cocoajin/p/4037675.html

你可能感兴趣的文章
查看binlog文件的2种方式
查看>>
新人程序员如何脱颖而出
查看>>
网络工程师真的也需要好好学习linux系统
查看>>
Entangle 2.0 “Sodium”正式发布
查看>>
Redis之父表示ARM服务器没戏!
查看>>
java调用cmd命令并捕获执行结果字符串的代码
查看>>
Eclipse中android sdk升级ADT版本过低解决办法
查看>>
MDT 2013 从入门到精通之无法分析或处理pass[specialize]文件
查看>>
桌面支持--512-Rear chassis fan not detected
查看>>
Django 开源相册组件介绍 django-photologue
查看>>
IntelliJ IDEA 14 创建Web项目
查看>>
Redis server命令
查看>>
PeerConnection
查看>>
关于ext-js 中的自定义校验
查看>>
服务端response对象属性和方法
查看>>
护眼色
查看>>
Linux下安装JDK
查看>>
axis2报错:The following error occurred during schema generation: null
查看>>
JS this指向详解
查看>>
自动布局
查看>>