How do I determine the OS version at runtime in OS X or iOS (without using Gestalt)?
问题 The Gestalt() function located in CarbonCore/OSUtils.h has been deprecated as of OS X 10.8 Mountain Lion. I often use this function to test the version of the OS X operating system at runtime (see the toy example below). What other API could be used to check the OS X operating system version at runtime in a Cocoa application? int main() { SInt32 versMaj, versMin, versBugFix; Gestalt(gestaltSystemVersionMajor, &versMaj); Gestalt(gestaltSystemVersionMinor, &versMin); Gestalt