您的位置:首页 > 移动开发 > Objective-C

cocoapod 引入头文件自动补齐

2016-03-29 15:18 405 查看

使用了一段时间CocoaPods来管理Objective-c的类库,方便了不少。但是有一个小问题,当我在xcode输入import关键字的时候,没有自动联想补齐代码的功能,需要手工敲全了文件名,难以适应。

在stackoverflow上找到了解决办法:

Go to the Target > \”Build Settings\” tab and find the \”User Header Search Paths\” setting.

Set this to \”$(BUILT_PRODUCTS_DIR)\” and check the \”Recursive\” check box.

Now the built target will search the workspace’s shared build directory to locate the linkable header files.

简单说就是这么几步:
选择Target -> Build Settings 菜单,找到\”User Header Search Paths\”设置项
新增一个值"${SRCROOT}",并且选择\”Recursive\”,这样xcode就会在项目目录中递归搜索文件

自动补齐功能马上就好使了。

另外 Cocoapods使用头文件时  如果用到了插件,Ctrl+h自动搜索头文件的那个,这个时候是用不了的,因为Cocoapods使用库文件的文件时,需要import《》而不是import“ ”这个需要注意
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  objective-c 管理