Re: Backwards compatibility with 10.0
Re: Backwards compatibility with 10.0
- Subject: Re: Backwards compatibility with 10.0
- From: Ali Ozer <email@hidden>
- Date: Mon, 1 Oct 2001 16:12:12 -0700
I intend on using dock notifications and the new APIs for NSSavePanels
(related to file extensions), but I'm not sure how to maintain
compatibility with people running 10.0.x.
I've read the little piece about versions in the AppKit release notes,
although it doesn't really clear up my questions.
With NSSavePanel it's fairly easy to see if it responds to the
selectors before using them, but dock notifications are a bit more
tricky, because of the NSInformationalRequest and NSCriticalRequest
constants.
What would be the best way to use these functions while running on
10.1, without sacrificing 10.0 compatability?
Actually the dock notifications and save panel seem to be in the same
category: In both cases, there are methods that were added in 10.1, and
you can check for existence of these methods with respondsToSelector:.
For dock notifications, the method is -[NSApplication
requestUserAttention:]. Or you can check against the overall AppKit
version (AppKit version in 10.1 is 620, so checking for
NSAppKitVersionNumber >= 620 is sufficient).
Of course this allows your app to work on both 10.0.x and 10.1, but
doesn't get you these features on 10.0.x. I'm also assuming you're
compiling on 10.1. If you're compiling on 10.0.x, yes, the constants
will not be available to use in the code, and you might have to use the
actual values.
Ali