CocaPods导入AFNetworking但不导入OHAttributedLabel
我正在使用CocaPods将AFNetowrking
和OHAttributedLabel
添加到我的项目中。 我安装了两个库。 AFNetworking
在我的项目中导入得很好。 但OHAttributedLabel
不是。 我不知道为什么!
Podfile
platform :ios, '6.0' pod 'AFNetworking' pod 'OHAttributedLabel'
安装两个库后,导入时
#import "AFHTTPClient.h" #import "AFJSONRequestOperation.h" #import "UIImageView+AFNetworking.h"
我没有得到任何错误,一切正常
但是当我试图导入时
#import #import #import
我正进入(状态
'OHAttributedLabel/OHAttributedLabel.h' file not found
错误
pod安装输出
Resolving dependencies of `./Podfile' Updating spec repositories Cocoapods 0.17.0.rc7 is available. Resolving dependencies for target `default' (iOS 6.0) Downloading dependencies Using AFNetworking (1.1.0) Installing OHAttributedLabel (3.4.1) Generating support files
建议说
确保您的项目使用Pods.xcconfig。 要选中此项,请选择项目文件,然后再次在第二个窗格中选择它,并在第三个窗格中打开“信息”部分。 在配置下,您应该为需要安装的pod的每个配置选择Pods.xcconfig。
我不知道在哪里添加这个。 这就是我的配置的样子
编辑
复制pods.xcconfig后
看起来你错过了正确的配置集。
你的项目信息应该是这样的
这可能听起来很愚蠢,但您是在尝试在工作区中构建和运行Pods项目而不是您自己的应用程序项目吗? 我已经多次犯了罪,并且看到过类似的错误!
在具有自定义编译器/链接器标志(如HEADER_SEARCH_PATHS和/或OTHER_LDFLAGS)(通过“标头搜索路径”或“其他链接器标志”目标设置)的项目上安装pod时,会遇到这些错误。 这些设置将覆盖您的pod配置文件,因为配置文件的优先级低于目标设置。
要解决此问题,您需要将$(inheritance)添加到目标构建设置中的HEADER_SEARCH_PATHS和其他已更改标志。 只需将它附加到最后:
另外需要注意的是,当你安装pod安装pod时,如果你设置了受影响的自定义标志,它应该用这样的消息警告你:
[!]从现在开始使用
myprojectname
。[!]目标
myprojectname [Debug]
会覆盖Pods/Pods.xcconfig'. - Use the
定义的OTHER_LDFLAGS
构建设置Pods/Pods.xcconfig'. - Use the
Pods/Pods.xcconfig'. - Use the
$(inheritance)`标志,或 – 从目标中删除构建设置。[!]目标
myprojectname [Debug]
会覆盖Pods/Pods.xcconfig'. - Use the
定义的HEADER_SEARCH_PATHS
构建设置Pods/Pods.xcconfig'. - Use the
Pods/Pods.xcconfig'. - Use the
$(inheritance)`标志,或 – 从目标中删除构建设置。[!]目标
myprojectname [Debug - Release]
会覆盖Pods/Pods.xcconfig'. - Use the
定义的OTHER_LDFLAGS
构建设置Pods/Pods.xcconfig'. - Use the
Pods/Pods.xcconfig'. - Use the
$(inheritance)`标志,或 – 从目标中删除构建设置。[!]目标
myprojectname [Debug - Release]
会覆盖Pods/Pods.xcconfig'. - Use the
定义的HEADER_SEARCH_PATHS
构建设置Pods/Pods.xcconfig'. - Use the
Pods/Pods.xcconfig'. - Use the
$(inheritance)`标志,或 – 从目标中删除构建设置。
转到您的taget构建设置 – >其他链接器标志 – >双击。 将$(inheritance)添加到新行。
- mkannotation视图中的button操作不起作用?
- iOS 7 SpriteKit – 创build游戏菜单/button(场景vs更多视图控制器)
- 使用swift将图像保存为相册
- iOS – 更改每个AVAssetTrack的音量
- 为什么在iOS中使用google places api加载地点导致查找地点ID查询错误?
- NSNetService工作正常,但不能得到hostName,解决导致错误
- ContentView中的button会导致MonoTouch运行时崩溃。 Monotouch 4.0中的错误?
- 如何保证主机应用程序和扩展使用的共享应用程序容器中的核心数据存储中的唯一条目?
- 在SpriteKit中不断移动