[CocoaApp isThisTiger]

Rob Keniger rob at menumachine.com
Mon Oct 22 20:17:07 PDT 2007


On 23/10/2007, at 1:08 PM, Rosyna wrote:

> Please read the documentation for the Gestalt selectors thoroughly.  
> You cannot miss it. It goes into great detail in the header about  
> how to handle 10.4.17.


To save everyone the pain, here's one way to do it:

long majorVersion, minorVersion, bugFixVersion;
	
Gestalt(gestaltSystemVersionMajor, &majorVersion);
Gestalt(gestaltSystemVersionMinor, &minorVersion);
Gestalt(gestaltSystemVersionBugFix, &bugFixVersion);
	
NSLog(@"Running on Mac OS X %d.%d. 
%d",majorVersion,minorVersion,bugFixVersion);

"Purist" Cocoa programmers should note that this is not a "Carbon"  
routine, you don't need to include Carbon.h. It's just a (very simple)  
C API.

--
Rob Keniger



More information about the MacOSX-dev mailing list