Preprocessor Deployment Target


Gerriet M. Denkmann
 

I need something like:

#if MACOSX_DEPLOYMENT_TARGET < 10.11 ← this of course does not work
… some code, which is only needed in this case …
#endif

Is this possible?

Gerriet.


James Walker
 

On 8/30/2017 1:58 AM, Gerriet M. Denkmann wrote:
I need something like:

#if MACOSX_DEPLOYMENT_TARGET < 10.11		← this of course does not work
… some code, which is only needed in this case …
#endif

Is this possible?

What you need is

#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11

MAC_OS_X_VERSION_MIN_REQUIRED is the deployment version, and MAC_OS_X_VERSION_MAX_ALLOWED is the SDK version.