問題描述
我確信這有一個簡單的答案,但它難住了我:(
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模板網!