Re: The weakest link: A question on olders SDKs
Re: The weakest link: A question on olders SDKs
- Subject: Re: The weakest link: A question on olders SDKs
- From: David Duncan <email@hidden>
- Date: Wed, 28 Nov 2012 13:05:51 -0800
On Nov 28, 2012, at 12:55 PM, Alexander von Below <email@hidden> wrote:
> I have a question on dyld and weak linking:
>
> I can build and run an app on iOS 4 which contains the symbol UIPageViewControllerOptionInterPageSpacingKey, which is actually available only on iOS 5 and up (I am not talking about using that symbol, just linking it)
>
> But if I use UIPageViewControllerOptionSpineLocationKey, another symbol for a UIPageViewController options key (but available in iOS 5 and up), I have to weak-link the UIKit Framework.
>
> Is this because UIPageViewControllerOptionInterPageSpacingKey was already present as private in iOS 4, or why is it weak linked, whereas UIPageViewControllerOptionSpineLocationKey is not?
If you have configured your application properly you should not need to weak link UIKit (if you do for some reason, then it is because a header is incorrectly defined to not have the symbol set to weak link given a correct configuration).
Generally a "correct configuration" means that you've set your deployment target to the oldest iOS version you wish to support. In the header case you can check to ensure that the symbol has the appropriate macro tied to it, typically an NS_AVAILABLE* macro.
*Note I just looked in the relevant UIKit header, and it appears that UIPageViewControllerOptionSpineLocationKey does /not/ in fact have the appropriate availability macro, which is causing your weak linking headaches. I think you can work around this by redeclaring the identifier with the appropriate macro (its available on iOS 5 or later).
--
David Duncan
_______________________________________________
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