Re: How to get the Mac OS X version?
Re: How to get the Mac OS X version?
- Subject: Re: How to get the Mac OS X version?
- From: Andreas Monitzer <email@hidden>
- Date: Sat, 8 Sep 2001 13:59:00 +0200
On Saturday, September 8, 2001, at 01:32 , Finlay Dobbie wrote:
NSDictionary *systemVersion = [NSDictionary
dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.
plist"];
You can then use the keys ProductBuildVersion and ProductVersion to
return the build number (e.g. 4Q12) and other version number (e.g. 10.0.4)
. I personally do this:
if (![[systemVersion objectForKey:@"ProductVersion"] isEqualToString:
@"10.0.4"]) {
int retVal = NSRunAlertPanel(@"Incompatible system?",@"You do not
appear to be running Mac OS X 10.0.4. This product has only been tested
on Mac OS X 10.0.4.\n\nIf you are using a version prior to 10.0.4, this
product will probably work, but you should update to 10.0.4 anyway.\n\nIf
you are using a version of Mac OS X later than 10.0.4, then please check
back to the web site at http://osx.hotlinex.org/ for an updated
version.",@"Continue anyway",@"Quit",nil);
if (retVal != NSAlertDefaultReturn)
[NSApp terminate:self];
}
You didn't prepare your app for localization! Even when you don't localize
it yourself, somebody else might want to do it.
andy
--
Description forthcoming.