在xcode 5 下,為了更易于開發,增加了modules和 auto-linking 這兩個新特性。用 @import 來增加框架 到項目中比用 #import會更有效. 我們來看看為什么:
"Modules for system frameworks speed build time and PRovide an alternate means to import APIs from the SDK instead of using the C preprocessor. Modules provide many of the build-time improvements of precompiled headers with less maintenance or need for optimization. They are designed for easy adoption with little or no source changes. Beyond build-time improvements, modules provide a cleaner API model that enables many great features in the tools, such as Auto Linking."
Modules and auto-linking 默認情況下是enabled的。 如果是舊的項目,你可以通過設置"Language - Modules." 來設置Enable Modules 和Link Frameworks Automatically 為Yes。
新聞熱點
疑難解答