AFNetworking 使用中报错
2015-09-18 11:49
316 查看
好久没用 http相关的库,今天使用, 选用AFNetworking,github下载,引入工程,记录下中间使用中遇到的问题
1.在非ARC工程中使用ARC的文件,在project->Build Phases->Compile Sources 文件编辑参数 -fobjc-arc
PS:在ARC项目中使用非ARC文件:文件编辑参数 -fnoobjc-arc
2.编译时报错,
解决 project->Build Phases-> Link Binary With Libraries 添加[/code]
解决方案: 1.在Info.plist中添加
2.在
1.在非ARC工程中使用ARC的文件,在project->Build Phases->Compile Sources 文件编辑参数 -fobjc-arc
PS:在ARC项目中使用非ARC文件:文件编辑参数 -fnoobjc-arc
2.编译时报错,
Undefined symbols for architecture i386: "_UTTypeCopyPreferredTagWithClass", referenced from: _AFContentTypeForPathExtension in AFURLRequestSerialization.o "_UTTypeCreatePreferredIdentifierForTag", referenced from: _AFContentTypeForPathExtension in AFURLRequestSerialization.o "_kUTTagClassFilenameExtension", referenced from: _AFContentTypeForPathExtension in AFURLRequestSerialization.o "_kUTTagClassMIMEType", referenced from: _AFContentTypeForPathExtension in AFURLRequestSerialization.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决 project->Build Phases-> Link Binary With Libraries 添加[/code]
MobileCoreServices.framework SystemConfiguration.framework
3. 请求url 出现错误:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. 原因iOS9引入了新特性[code]App Transport Security (ATS),要求App内访问的网络必须使用
HTTPS协议。[/code]
解决方案: 1.在Info.plist中添加
NSAppTransportSecurity类型
Dictionary。
2.在
NSAppTransportSecurity下添加
NSAllowsArbitraryLoads类型
Boolean,值设为
YES
4.编译出现 AF_Require_noErr(SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data), _out); 出现kSecFormatUnknown无法识别 如果是2.6版本,请换2.5 就没问题了
相关文章推荐
- laravel 去掉index.php伪静态
- Android Studio系列教程四--Gradle基础
- MapReduce中的两表join几种方案简介
- oracle经验
- 使用U盘代替光盘来刻录ISO镜像文件的方法
- 通过今目标问题反思自身
- Linux的基础文件描述符
- Proxy,InvocationHandler动态代理学习笔记
- 初次接触volley网络框架,进行初步封装使用
- nginx 负载均衡之 ngx_http_upstream_hash_module
- Calling Executable Files in PowerShell
- [转]微信公众号配置
- Remove Duplicates from Sorted Array
- 数据结构中的常用查找
- EOF是什么?
- 前端资料收集
- github常用命令
- udhcpc遇到问题
- Android中内存泄露监测
- C++标准库:bitset 用法整理 (来自网易 happyboy200032的博客)