我确信这有一个简单的答案,但它难住了我:(
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 文档(在 this page),可以有条件地链接框架 - 但我一生无法弄清楚如何设置其他链接器标志来执行此操作.谁能告诉我这是怎么做到的?
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?
在你的 Target -> Build Settings 中,搜索 Other Linker Flags 并点击发布类型(Debug 或 Release),然后在右下角点击添加构建设置 -> 添加条件设置,这将为您提供 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 版本的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!