RestKit和AFNetworking生成错误
当我尝试将RestKit api导入到项目中时,出现以下错误:
/Documents/Code/RestTest/RestKit/Code/Network/RKHTTPRequestOperation.h:21:9: 'AFNetworking.h' file not found
我已经安装RestKit作为一个git子模块,我如何解决RestKit的AFNetworking的依赖?
一旦克隆,只需在RestKit目录中执行:
git submodule update --init --recursive
这将拉动AFNetworking版本RestKit的需要
如果你使用CocoaPods将自动完成所有这一切。
从RestKit安装文档:
如果不可用,请安装CocoaPods:
$ [sudo] gem安装cocoapods
$ pod设置编辑您的Podfile并添加RestKit:
$编辑Podfile
平台:ios,'5.0'
pod'RestKit',:git =>'https://github.com/RestKit/RestKit.git',:branch =>'development'testing和search是可选组件
pod'RestKit / Testing',:git =>'https://github.com/RestKit/RestKit.git',:branch =>'development'
pod'RestKit / Search',:git =>'https://github.com/RestKit/RestKit.git',:branch =>'development'安装到您的项目中:
$ pod安装
请注意,如果安装失败,可能是因为您正在安装的Git版本低于CocoaPods所期望的版本。 请确保通过执行git –version来运行Git> = 1.8.0。 您可以通过执行pod install –verbose来获得安装详细信息的完整画面。
这可能会帮助一些人。 我完全跳过了RestKit wiki中的这个部分,专门用来避免AFNetworking错误:
我有一个'AFNetworking.h' file not found
错误,这是因为我错过了.pch中的这些导入。
- 如何清除AFNetworking中的图像caching或任何caching?
- AFNetworking – 如何在不使用键值对的情况下input和输出原始数据?
- AFNetworking POST方法调用
- NSJSONSerialization + AFNetworking无法识别select器错误
- Cocoapod:为什么Xcode构build过程试图find已经从我的项目中删除的库
- SSL与AFNetworking固定
- 如何等待响应和parsing在networkingiOS中完成的XML
- AFNetworking从asynchronous任务iOS返回值
- AFNetworking – 无效的参数不令人满意:url