Using newer APIs and deprecated APIs for older releases...
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