有条不紊地包括不同iOS SDK版本的库? [英] Conditionally including a library for different iOS SDK versions?

查看:106
本文介绍了有条不紊地包括不同iOS SDK版本的库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确信这有一个简单的答案,但它让我感到困惑:(

I'm sure this has got a simple answer, but it's stumping me :(

我正在尝试构建一个可在iOS版本4.3上运行的应用程序5.0。我很想在运行时使用 -respondsToSelector 检查功能,但为了使用Twitter功能,我需要包含Twitter库。

I'm trying to build an app that will run on iOS versions 4.3 and 5.0. I'm fine with the idea of checking for capabilities at runtime with -respondsToSelector, but in order to use the Twitter functionality I need to include the Twitter library.

这导致编译器在构建4.3时失败,这是我期望的。根据Apple文档(在此页),这是可能的有条件地链接框架 - 但我不能为我的生活弄清楚如何设置其他链接器标志来执行此操作。任何人都可以告诉我这是如何完成的?

That causes the compiler to fail when building for 4.3, which I'd expect. According to the Apple docs (at the very bottom of this page), it's possible to link frameworks conditionally - but I cannot for the life of me figure out how to set the Other Linker flags to do this. Can anyone tell me how this is done?

推荐答案

在目标 - >构建设置中,搜索其他链接器标志并单击发布类型(Debug或Release),然后在右下角,单击Add Build Setting - > Add Conditional Setting,这将为您提供SDK弹出窗口以及指定任何其他标志的能力。

In your Target -> Build Settings, search for Other Linker Flags and click on the type of release (Debug or Release) and then on the bottom right, click Add Build Setting -> Add Conditional Setting and that will give you the SDK popup and the ability to specify any additional flags.

这篇关于有条不紊地包括不同iOS SDK版本的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆