• 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
Using newer APIs and deprecated APIs for older releases...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using newer APIs and deprecated APIs for older releases...


  • Subject: Using newer APIs and deprecated APIs for older releases...
  • From: Chas Spillar <email@hidden>
  • Date: Tue, 03 Jan 2006 13:18:07 -0800
  • Thread-topic: Using newer APIs and deprecated APIs for older releases...

Happy New Year,

I am working on code which was using the now deprecated (in 10.4) calls
CGColorSpaceDeviceRGB() and CGColorSpaceDeviceGray().  Because of changes in
the OS this causes problems with Tiger so I need to instead use
CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB) and
CGColorSpaceCreateWithName(kCGColorSpaceGenericGray).

I believe the intent of the code was to not do color mapping and I think
using the new calls will work on Tiger.  Thus, I need to run the old code on
OS versions earlier than 10.4 (e.g. 10.2 and 10.3) and the new code on 10.4
and later.  In the pre-carbon days we would use Gestalt() for these kinds of
things and the Apple position was to not check for OS, but check for
features.

In the 10.x world, and specifically in Cocoa, what is the correct way to do
this.  In similar issues I have dealt with I have used performsSelector: to
determine if an Objective-C API was available.

My question is:

1) What is the "correct" way to do this?  Should I use Gestalt or some of
the other methods to check for the OS release, or is there some finer grain
approach for this particular API that I should use?

2) I think these APIs are available on the three OS versions I am targeting
(10.2,10.3,10.4), so weak linking isn't an issue.  But, how would I setup
weak linking if it were?

Thank you for your help,

Chas.


 _______________________________________________
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: Using newer APIs and deprecated APIs for older releases...
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: CoreData modeling a mutable attribute set for an entity
  • Next by Date: Binding to Self Update
  • Previous by thread: Re: currentDocument returns nil (and it shouldn't)
  • Next by thread: Re: Using newer APIs and deprecated APIs for older releases...
  • Index(es):
    • Date
    • Thread