How to check Mac OS X version at runtime

前端 未结 5 1301
孤街浪徒
孤街浪徒 2021-01-12 22:48

I am using below code to check OS X version at runtime.

if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_10)
{
    /* On a 10.10.x or earlier s         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-12 23:30

    Starting with Yosemite, you can use [NSProcessInfo processInfo].operatingSystemVersion and test the result in the struct NSOperatingSystemVersion.

提交回复
热议问题