[CocoaApp isThisTiger]

Finlay Dobbie finlay.dobbie at gmail.com
Tue Oct 23 06:52:04 PDT 2007


On 23/10/2007, Alastair Houghton <alastair at alastairs-place.net> wrote:
> > Use Gestalt() and be done with it. It is the correct and most
> > robust way to get the system version.
>
> Though whichever way you do it, it's possible to screw up if you get
> your comparisons wrong.  It slightly easier to mess up if you're
> trying to scan a version string from a file, of course, but that
> doesn't mean you can't do it properly.  I do note though that one of
> Apple's guys said that reading that file was wrong and that we should
> use Gestalt.

The file is an implementation detail. Don't rely on it. The only
public defined interface to the values defined in the file is through
Gestalt. There are SPI in CoreFoundation, but they don't really buy
you anything over using Gestalt.

> On 22 Oct 2007, at 19:26, Finlay Dobbie wrote:
>
> > You can use NSAppKitVersionNumber, but "hard core no Carbon Cocoa
> > developers" need to grow up and stop being babies.
>
> Speaking as someone who would rather avoid Carbon where possible
> (which is not quite the same thing, I must emphasise), I find that
> the You-Should-Use-Carbon-Because-Its-Better camp are much more
> vociferous than the Hard-Core-No-Carbon camp (which is not surprising
> because I'm not actually convinced that the latter exists).  And
> given that the "debate" is between people who do exist and people who
> do not, it's frankly rather boring and not a little preachy.

Your experience does not mesh with mine.

> Any sensible/pragmatic developer---and I think that's most of us---
> will use a Carbon API *if* they know about it and if it makes their
> life easier or provides a better user experience.

So, again, use Gestalt. It's the best tool for the job. Whether it's
Carbon or Cocoa is irrelevant.

 -- Finlay


More information about the MacOSX-dev mailing list