Re: How to get warnings for missing methods in older SDKs
Re: How to get warnings for missing methods in older SDKs
- Subject: Re: How to get warnings for missing methods in older SDKs
- From: Chris Suter <email@hidden>
- Date: Sat, 26 Mar 2011 09:42:56 +1100
Hi Ben,
On Fri, Mar 25, 2011 at 9:19 PM, Ben Staveley-Taylor
<email@hidden> wrote:
> Thanks very much, Chris. That's probably good enough to do what I need for now.
>
> It's not perfect because that gives a hard error rather than a warning, so you can't ignore it while trying things out, and more to the point you can't use 10.6-only calls at all (well, you can by casting to anonymous id and Class types, but then you get no type checking.)
Well you couldn't easily do that with the 10.5 SDK either. Anyway, you
can probably hack something up to do what you want. Something like
this in your prefix header would probably work (before any other
frameworks), or in your preprocessor flags if you prefer:
#define MAC_OS_X_VERSION_MAX_ALLOWED 9999
#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER DEPRECATED_ATTRIBUTE
WEAK_IMPORT_ATTRIBUTE
You'll get a deprecated warning instead of an unavailable error.
As before, that's untested.
> There seems to be widespread confusion about this. It strikes me that setting MACOSX_DEPLOYMENT_TARGET to an old version should do what I describe, but I don't imagine I'll get Apple to agree with me.
No, MACOSX_DEPLOYMENT_TARGET means the *minimum* version that should
be supported, not the maximum. The maximum defaults to the SDK version
unless you specify it otherwise.
Most of this stuff is dealt with in the AvailabilityMacros header file
so have a look in that if you're interested, although the deployment
target (the minimum version to be supported) affects what the linker
does (and possibly the compiler), which is the reason for the
-mmacosx-version-min flag.
Kind regards,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden