Getting Mac OS X Version Information At Runtime

This article has been updated, and republished here.

Advertisements
Explore posts in the same categories: Cocoa, Leopard, MacOSX, Objective-C, Programming, Sample Code

2 Comments on “Getting Mac OS X Version Information At Runtime”

  1. Blake C. Says:

    usingLeopard() should probably also check that gestaltSystemVersionMajor is 10.


  2. Thanks for pointing that out, the code has been changed.

    At the same time, I can’t really imagine a case today, or in the foreseeable future, where gestaltSystemVersionMajor wouldn’t be 10 when queried from Cocoa code. I don’t know of any Cocoa code that targets OS 9. And if gestaltSystemVersionMajor was > 10, I somehow don’t think I would be using Gestalt() anymore.

    In other words, it seems like verifying gestaltSystemVersionMajor is a waste of time. There’s nothing wrong with doing it though (besides an extra 1-2 lines of code). At least that’s my understanding.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: