我正在使用通过
Cocoapods安装的库,它依赖于AFNetworking作为链接框架.安装库之后,我的项目将无法编译,因为无法找到导入的AFNetworking文件.
但是,似乎模块导致问题,因为如果我从
#import“AFHTTPRequestOperationManager.h”
至
#import< AFNetworking / AFHTTPRequestOperationManager.h>
..错误消失.我宁可不去改变这些链接库中的代码,那么如何让我的库成功地找到AFNetworking文件?
编辑这是我的podfile:
# Uncomment this line to define a global platform for your project
# platform :ios,'6.0'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios,'8.0'
target 'Motospot' do
pod 'Alamofire','~> 1.2'
pod 'youtube-ios-player-helper','~> 0.1.1'
pod 'BDBOAuth1Manager'
end
target 'Motospottests' do
end
解决方法
请检查配置文件 – AFNetworking版本
改成
pod 'AFNetworking','~> 2.5.4'
并使用
#import "AFHTTPRequestOperationManager.h"