• 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
Re: Checking System Version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking System Version


  • Subject: Re: Checking System Version
  • From: Finlay Dobbie <email@hidden>
  • Date: Mon, 1 Aug 2005 16:38:21 +0100

On 8/1/05, Philip Dow <email@hidden> wrote:
> 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?

Use NSClassFromString instead of objc_lookUpClass :-)
I believe the preferred solution is to test for what you're looking
for... So if NSClassFromString(@"NSViewAnimation") returns nil then
you just don't use it.

> 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.

Well, you can determine what the AppKit version number is on 10.4 for
yourself if you really want to. It looks to me that it's 824.

> 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.

Well, you're already indirectly linking against the Carbon frameworks,
so what's the problem?

 -- Finlay
 _______________________________________________
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: Philip Dow <email@hidden>
References: 
 >Checking System Version (From: Philip Dow <email@hidden>)

  • Prev by Date: Re: Checking System Version
  • Next by Date: CoreData & Bindings: How to make a predicate search a to-many rel ationship
  • Previous by thread: Re: Checking System Version
  • Next by thread: Re: Checking System Version
  • Index(es):
    • Date
    • Thread