• 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: How to get system version?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get system version?


  • Subject: Re: How to get system version?
  • From: "Alastair J.Houghton" <email@hidden>
  • Date: Fri, 17 Oct 2003 16:16:05 +0100

On Friday, October 17, 2003, at 02:52 pm, Giovanni Donelli wrote:

Hello Gurus,
I wanna perform different code whether I'm in Jaguar or in Panther. But keeping the same application.

can I get the system version somehow so that I can do:

Someone else has already pointed you at one way of doing this, so I'm just going to issue a quick warning:

It's often better *not* to use system or library version numbers to determine support for a particular feature; Mach-O and Objective C have lots of nice features you can use to test for the specific function or method that you want to use... for example, in ObjC you can call -respondsToSelector: to find-out whether an object supports a particular method.

If you're after a C function, rather than an ObjC method, and it may or may not be present on the system, there are a couple of techniques you can use that will work; Mach-O has a weak linking feature that means that if the symbol is found in an external library, you get it, otherwise you get NULL. I don't think that's in 10.0, though, so if you need to support that too, you'd need to use dyld (or the libdl wrapper).

Kind regards,

Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >How to get system version? (From: Giovanni Donelli <email@hidden>)

  • Prev by Date: Re: Restraining window movement + gridding
  • Next by Date: Re: Trapping insert nil value into dictionary?
  • Previous by thread: Re: How to get system version?
  • Next by thread: How to get system version?
  • Index(es):
    • Date
    • Thread