Re: NSAppKitVersionNumber for 10.3.0?
Re: NSAppKitVersionNumber for 10.3.0?
- Subject: Re: NSAppKitVersionNumber for 10.3.0?
- From: Chuck Soper <email@hidden>
- Date: Mon, 20 Sep 2004 10:03:26 -0700
This is how I version check (from awakeFromNib). Since
LSMinimumVersion doesn't work in all cases, I avoid it. I took this
approach after reading 'Runtime Version Check' here:
http://developer.apple.com/releasenotes/Cocoa/AppKit.html
This approach is very straightforward and I think it's the
recommended approach, but if I'm mistaken please let me know. Also,
the logic of the 'if' statement and the alert text below could be
improved (this is just an example).
Chuck
BOOL compatibleAppKit = FALSE;
if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_0) {
// On a 10.0.x or earlier system
compatibleAppKit = FALSE;
} else if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_1) {
// On a 10.1 - 10.1.x system
compatibleAppKit = FALSE;
} else if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_2) {
// On a 10.2 - 10.2.x system
compatibleAppKit = TRUE;
} else {
// 10.3 or later system
compatibleAppKit = TRUE;
}
if (!compatibleAppKit) {
NSString *versTitleText = NSLocalizedString(@"Minimum system not met.", nil);
NSString *versMessageText = @"Mac OS X 10.2 or better is required.";
NSRunCriticalAlertPanel(versTitleText, versMessageText, @"Exit", nil, nil);
[NSApp terminate:self];
}
At 8:19 AM -0400 9/20/04, Jim Correia wrote:
On Sep 20, 2004, at 7:15 AM, Rainer Brockerhoff wrote:
AFAIK 10.1.x ignores LSMinimumSystemVersion, 10.2.x quits with a
message, and 10.3.x quits without a message. So to be safe I write:
[...]
...with the added bonus that you can write your own
apologetic/snippy/obscure message ;-)
The downside to this approach is that if your app requires 10.3, you
are plain out of luck on 10.1, and you have to make sure you weak
link so that the app can close and come up on 10.2 to just tell
people that the app won't run there.
Today the situation isn't terrible - on 10.2 you can use
LSMinimumVersion and on 10.3 you'll close, so you can run or tell
the user yourself.
Once 10.4 ships and apps require that, unless the LSMinimumVersion
bug has been fixed, people will have no choice but to weak link and
come up and tell the user that their system is too old if you want
to provide a friendly experience for people who didn't manage to
find the system requirements with the product info.
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden