Thanks for the tip...
When I read your reply about NSAppKitVersionNumber returning the 10.5 number (949.27) even when linked against the 10.4 SDK, I thought -- no! you must be wrong -- that would be insane and useless. How would an application ever tell which SDK it was built against?
But I checked, and, sure enough, my application, running on 10.5 but linked against the 10.4 SDK, shows the 949.27. This is the same value I get as when my application is linked against 10.5.
Of course, this is a HUGE problem for any application that tries to determine what behavior it is currently getting.
So this problem is either a GIGANTIC BUG in how AppKit is linked; or Xcode 3.1 is doing something funny. Can anyone verify this under Xcode 3.0 and Mac OS X 10.5?
Just do the following in Xcode 3.0: NSLog( @"%f", NSAppKitVersionNumber );
Before you dismiss this message (Eric), I think the case in point is how CILinearGradient works. It is NOT backwards compatible. The Core Image guys probably (correctly) assumed that NSAppKitVersionNumber would return the version of AppKit _linked_ against rather than _available on the system_.
What's going on?
P.S. I have to admit that I'm struck by just how _bad_ this NSAppKitVersionNumber behavior is. I hope I'm missing something...
On Thu, Mar 20, 2008 at 3:00 PM, Eric Schlegel <
email@hidden> wrote:
On Mar 19, 2008, at 12:40 PM, Chris Meyer wrote:
> Building against 10.4 doesn't seem to work. And since I'm built
> against 10.4, I can't check the AppKit version (it will just report
> the 10.4 version). So what should I do?
If you're referring to checking NSAppKitVersionNumber, I'm pretty sure
that you'll see an appropriate value in there when running on 10.5 to
let you know that you're on 10.5. That's a global variable coming from
the AppKit binary that's loaded at runtime; it's not a compile-time
symbol. You should be able to use to determine your system version.
If for some reason that didn't work, you could also use Gestalt with
gestaltSystemVersionMajor and Minor.
-eric