国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

在ios7下,使用@import代替#import

2019-11-14 20:33:39
字體:
來源:轉載
供稿:網友

在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。

 另外一個使用moudules的好處是你再也不用去鏈接你的framework到你的項目了。
例如,在以前,如果你要使用MapKit這個框架,你要這樣做
1) 使用語句 #import <MapKit/MapKit.h> 導入框架
2) 去到項目的build phases 設置項,找到MapKit.framework.并加入到Link Binary With Libraries里面。
如果使用modules的話,只需要加入語句 "@import MapKit;" 你就可以開始使用了,根本不需要鏈接到你的項目。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 汽车| 楚雄市| 北流市| 礼泉县| 瓦房店市| 浙江省| 五台县| 北票市| 全椒县| 栖霞市| 安多县| 汉源县| 山西省| 偏关县| 石城县| 乾安县| 长顺县| 漠河县| 延庆县| 中江县| 中阳县| 巴塘县| 昭苏县| 遵化市| 靖安县| 确山县| 奉新县| 和平区| 商洛市| 南江县| 丹棱县| 武穴市| 松阳县| 东山县| 图木舒克市| 苏州市| 孝昌县| 龙海市| 吉安市| 姜堰市| 新巴尔虎左旗|