mac 下获取 os x 的系统版本,使用 oc cocoa
mac 下获取 os x 的系统版本,使用 oc cocoa
1:
#import <CoreServices/CoreServices.h> 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"];
参考:http://stackoverflow.com/questions/6492038/find-mac-os-x-version-number-in-objective-c
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。