Re: Developing for 10.4 and up
Re: Developing for 10.4 and up
- Subject: Re: Developing for 10.4 and up
- From: Stonewall Ballard <email@hidden>
- Date: Fri, 15 Jan 2010 15:56:12 -0500
On Jan 15, 2010, at 1:31 PM, Stonewall Ballard wrote: On Jan 15, 2010, at 12:44 PM, Chris Espinosa wrote: 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. If that's so, why does Apple supply the 10.4 and 10.5 SDKs with the developer tools?
Because newer SDKs usually adopt other requirements (compilers, etc.) that will force you to update your code in order to recompile. Developers who don't want to invest in upgrading their code base often want to stick with an older SDK, even though that cuts them off from new APIs.
I just read through AvailabilityMacros.h, and from that I gather that when using the 10.6 SDK, I have to explicitly set MAC_OS_X_VERSION_MAX_ALLOWED to 10.4 if I want to get errors when I try to use anything that wasn't available in 10.4.
Thanks for the clarification!
One common usage of these macros would be to temporarily set MAC_OS_X_VERSION_MAX_ALLOWED to be equal toMAC_OS_X_VERSION_MIN_REQUIRED and rebuild one's application to see which APIs are being used that are not present in the minimum required OS version (compilation will produce errors for each usage of the now suddenly unavailable routines). For example, MAC_OS_X_VERSION_MIN_REQUIRED might be set to 10.1 (represented as 1010 to the compiler) and MAC_OS_X_VERSION_MAX_ALLOWED would be set to 10.1 as well, to see which APIs are being used that were introduced in, say, 10.2. This usage now works for users of both the Cocoa and Carbon frameworks, as of the December 2002 Developer Tools.
When I tried this, the compiler did not even warn when I used a function that's available only in a Mac OS version greater than what I set MAC_OS_X_VERSION_MAX_ALLOWED to. Preprocessing showed that the function I tried had __attribute__((unavailable)) attached to it, so it expanded correctly. Was this behavior changed?
It seems that in order to get actual compile-time errors when I try to use something not defined in 10.4 for an app that must run in 10.4, I have to use the 10.4 SDK.
- Stoney
|
_______________________________________________
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