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: Quincey Morris <email@hidden>
- Date: Sun, 27 Mar 2011 10:39:20 -0700
On Mar 27, 2011, at 05:12, Alexander von Below wrote:
> Am 27.03.2011 um 13:21 schrieb Christiaan Hofman:
>
>> I am not saying that it would not be nice to know whether you've used new API in an unsafe manner, but I see no way how the compiler can know about that, and therefore warn about it. I don't want to have loads of warnings about correct use of API.
> The SDK has absolutely clear, machine readable hints about when something is available. It is completely beyond me why Xcode does not offer a compile run to show me where I am using something that is not available on my deployment OS
On Mar 27, 2011, at 03:57, Ben Staveley-Taylor wrote:
> Otherwise I have created a product that will not run on MACOSX_DEPLOYMENT_TARGET, which surely is contrary to the purpose of the exercise.
No. You're both still going round and round the same circle. You both have things backwards. :)
If your purpose is to avoid running newer API on an older Mac that doesn't have it, you have 2 choices, the hard way or the easy way:
1. The easy way is to build against the *older* SDK -- the *minimum* OS version you support. Choosing this path assumes that newer OS versions can simulate the old one***. This is the easy path because the checks against using newer API happen at compile time.
2. The hard way is to build against the *current* SDK -- neither the minimum nor the maximum version you support. Choosing this path requires you to carefully make sure *at run time* you're not using the wrong API. In this case, the deployment target (basically) hacks your executable to force it to run on older OS versions. That only works because you've taken on the responsibility of enforcing compatibility yourself, at run time.
So, again, the approach to give you what you want -- an app that's written "for" an older OS -- is to build against its SDK. The only difficulty you have now is that you'll have to use Xcode 3.2 to build against 10.5, because Xcode 4 unfortunately can't do it.
*** And the complication that the discussion has ignored so far is that quite a few APIs *behave differently* depending on the SDK you built against. If your code is written "for" an earlier OS that had a frameworks bug, and your app relies on that bug, you need to have built against that older SDK in order for newer Mac OS versions to simulate the old one by reproducing the buggy behavior for you.
So, excuse me for belaboring the point, if you were to build against a newer SDK -- even if you could convince the compiler to complain about API newer than your deployment target version -- your application might not work.
Can we stop discussing this now??
_______________________________________________
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