Conditionally including a library for different iOS SDK versions?(有条件地包含不同 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 文档(在 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 版本的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有条件地包含不同 iOS SDK 版本的库?
基础教程推荐
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
