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: Ben Staveley-Taylor <email@hidden>
- Date: Fri, 25 Mar 2011 10:19:16 +0000
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.)
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.
-- Ben.
On 25 Mar 2011, at 09:49, Chris Suter wrote:
> Hi Ben,
>
> On Fri, Mar 25, 2011 at 8:43 PM, Ben Staveley-Taylor
> <email@hidden> wrote:
>> What's the the best way to identify which methods are not available on earlier OS releases now that we are obliged (in Xcode 4) to use the 10.6 SDK?
>>
>> Up until now (in Xcode 3) I have been using SDKROOT=macosx10.5 with MACOSX_DEPLOYMENT_TARGET=10.5. That does exactly what I want; if I accidentally use a method that is 10.6 only I get a compile time warning, which reminds me to put in some workaround code.
>>
>> However, with SDKROOT=macosx10.6 + MACOSX_DEPLOYMENT_TARGET=10.5 I get no warnings. Can it be true that the official line is it's just up to me to read the documentation very carefully for every method I use? I've seen others propose copying the 10.5 SDK into Xcode 4, and a response that that is unsupported and generally a bad idea. Do we know of a better "clean" solution yet?
>
> To your preprocessor definitions, or in your pch file (before
> including any frameworks), add:
>
> MAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_5
>
> That should work (but I haven't tried it).
>
> 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