• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Checking System Version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking System Version


  • Subject: Checking System Version
  • From: Philip Dow <email@hidden>
  • Date: Mon, 1 Aug 2005 13:17:54 +0200

Hiya

I'd like to check for the system version from within Cocoa. I am building my app using the 10.4 frameworks but deploying for 10.3 and above, weak linking in the process. There are situations where I'd like to take advantage of newer classes, specifically NSViewAnimation and NSPredicate, but I need to check the system version before using them.

Right now I am importing "/usr/include/objc/objc-runtime.h" and calling objc_lookUpClass([@"NSViewAnimation" cString]) at init to check for the view animation. If it exists, I set a bool in user defaults that tells me the system is 10.4. Although this works, it seems sloppy. Is there a better way?

I found an excellent article over at cocoadevcentral that documents a couple of options. I could check the NSAppKitVersionNumber, however, even in my 10.4 frameworks, the highest constant defined by NSApplication.h is NSAppKitVersionNumber10_3_5. That won't do. Alternately, I could call Gestalt() from within the Carbon frameworks and check that the version returned is greater than 0x1040. I like this better than what I'm doing now, but I have to add the carbon frameworks.

Is there a way to check for 10.4 from within the Cocoa frameworks?

-Phil
http://phildow.net
_______________________________________________
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


  • Follow-Ups:
    • Re: Checking System Version
      • From: "Sean McBride" <email@hidden>
    • Re: Checking System Version
      • From: glenn andreas <email@hidden>
    • Re: Checking System Version
      • From: Finlay Dobbie <email@hidden>
    • Re: Checking System Version
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Compositing an image on a NSButtonCell subclass ?
  • Next by Date: A lot of Apple jobs posted today...
  • Previous by thread: Compositing an image on a NSButtonCell subclass ?
  • Next by thread: Re: Checking System Version
  • Index(es):
    • Date
    • Thread