Re: Value of the MAC_OS_X_VERSION_MIN_REQUIRED macro
Re: Value of the MAC_OS_X_VERSION_MIN_REQUIRED macro
- Subject: Re: Value of the MAC_OS_X_VERSION_MIN_REQUIRED macro
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sat, 20 Feb 2016 22:42:28 +0100
It is unsafe to use availability conditional in headers.
You can’t guarantee that the framework client will has the same settings that what was used to compile the framework.
That said, if you want to use weak when compiling for ARC and assign otherwise, you can just use #if __has_feature(objc_arc)
> Le 20 févr. 2016 à 19:00, Ilya Kulakov <email@hidden> a écrit :
>
> Hi,
>
> I would like to add support for ARC's weaks to my framework that supports Mac OS X down to 10.6
>
> My current solution is:
>
> #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
> @property (weak) NSObject<SRValidatorDelegate> *delegate;
> #else
> @property (assign) NSObject<SRValidatorDelegate> *delegate;
> #endif
>
> However, the value of MAC_OS_X_VERSION_MIN_REQUIRED is always 1070 despite of set Deployment Target (I compile on 10.11).
> Why is it so and what solution could I use in my situation?
>
> Best Regards,
> Ilya Kulakov
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden