• 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: Determining OS at Runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining OS at Runtime


  • Subject: Re: Determining OS at Runtime
  • From: Sherm Pendley <email@hidden>
  • Date: Wed, 1 Jul 2009 20:22:15 -0400

On Wed, Jul 1, 2009 at 7:24 PM, iseecolors<email@hidden> wrote:
> I need to support 10.4 in my application, but it uses some Carbon APIs that
> are deprecated in 10.5 and I am using some new 10.5 APIs that require the
> 10.5 SDK.
>
> I am sure I have seen this before, but I have been unable to find it in the
> Archive.  How do I determine at runtime which OS version I am running on?

Just check for the presence of the function you want to call. In
Xcode, set your deployment target to 10.4, so that Leopard-only
symbols will be weak-linked. Then just check the symbol for NULL
before calling it:

    if (SomeLeopardFunction != NULL) {
        SomeLeopardFunction();
    } else {
        TigerFunction();
    }

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Determining OS at Runtime
      • From: Steve Christensen <email@hidden>
References: 
 >Determining OS at Runtime (From: iseecolors <email@hidden>)

  • Prev by Date: Re: Drawing the background of a single row in NSTableView
  • Next by Date: Re: User interface validation doesn't work, right?
  • Previous by thread: Determining OS at Runtime
  • Next by thread: Re: Determining OS at Runtime
  • Index(es):
    • Date
    • Thread