简体   繁体   English

需要OS X> = Lion的应用程序

[英]Requiring OS X >= Lion for an application

One of the open source software I'm contributing to has recently started using features that are only available on OS X 10.7 and later. 我正在贡献的一种开源软件最近开始使用仅在OS X 10.7和更高版本上可用的功能。 We'd like to detect at startup time (or preferably before the program is even started, if some DMG metadata allows for that) if a user is using an older version of OS X and display a message telling him to upgrade his OS (or use an older version of our software). 我们想在启动时(或最好在程序启动之前,如果某些DMG元数据允许的话)检测用户是否在使用旧版本的OS X,并显示一条消息,告诉他升级操作系统(或使用我们软件的旧版本)。

What is the best way to do this? 做这个的最好方式是什么? I'm not an OS X developer so please keep it as simple as possible :) 我不是OS X开发人员,所以请尽量简化:)

You can do it using methods in the C std library. 您可以使用C std库中的方法来执行此操作。 This question explains how Getting the OS version in Mac OS X using standard C 此问题说明如何使用标准C在Mac OS X中获取OS版本

As mentioned in the comments this was deprecated in 10.8. 如评论中所述,在10.8中已弃用。 This question explains a work around for the time being How do I determine the OS version at runtime in OS X or iOS (without using Gestalt)? 该问题暂时说明了解决方法。 如何在运行时在OS X或iOS中确定OS版本(不使用Gestalt)?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM