On Jan 15, 2010, at 11:13 AM, Alexander von Below wrote:
Am 15.01.2010 um 18:44 schrieb Chris Espinosa:On Jan 15, 2010, at 7:21 AM, Stonewall Ballard wrote:
Have I just been assuming all along that you need to use the base SDK corresponding to the minimum OS version the app runs on?
That's an incorrect assumption. You set the SDK according to the latest SDK you want to use APIs from. You set the Deployment Target to the minimum OS you want the app to run on.
But doesn't that mean the compiler will not warn me about methods and functions which are not available in the older SDK?
Yes, if you want access to new APIs but you need to deploy on older machines, it's up to you to know when you're using newer APIs. One handy thing to do is to set the Base SDK to the newer OS (e.g. 10.6) and use the "Active SDK" override in the toolbar or Project Menu to do a test-build with the older SDK. That will flag all your uses of new APIs as errors, and you can make sure those uses are properly conditionalized to only be called when you know you're running on 10.6.
I also was under the assumption that the safest bet was to set the SDK to the earliest version of Mac OS X that I want my software to be compatible with.
Yes, that's the safest bet, but it cuts you off from access to new APIs. Incidentially, it also makes sure your app is running in a kind of compatibility mode; AppKit can tell which SDK you kinked against, and it actually opts out of certain behavior-changing bug fixes for apps linked against older APIs. So while you get consistent behavior, you might not get improved 10.6 functionality even when running on 10.6 if you link against the 10.4 SDK.
Here's a good overview of the relative function of SDKROOT v. MAC_OS_X_DEPLOYMENT_TARGET: