AFNetworking提示3840 Unescaped control character around character XXX
处理办法:找到AFNetworking包中AFURLResponseSerialization.m文件在第250行修改代码如下:
if (data.length > 0 && !isSpace) {
NSString* sInvalid = [NSString stringWithUTF8String:[data bytes]];
// 从服务器收到的类似上一行的数据
sInvalid = [sInvalid stringByReplacingOccurrencesOfString:@"\r" withString:@""];
sInvalid = [sInvalid stringByReplacingOccurrencesOfString:@"\t" withString:@""];
NSData *dataa = [[sInvalid stringByReplacingOccurrencesOfString:@"\n" withString:@""] dataUsingEncoding:NSUTF8StringEncoding];
if (dataa == nil) {
dataa = data;
}
responseObject = [NSJSONSerialization JSONObjectWithData:dataa options:self.readingOptions error:&serializationError];
} else {
return nil;
}
AFNetworking提示3840 Unescaped control character around character XXX的更多相关文章
- Json解析报错: Error is : Unescaped control character...的解决方法
在利用json-framework来实现json解析的过程时,会出现"-JSONValue Failed. Error is : Unescaped control character&qu ...
- iOS解析JSON字符串报错Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence around character 586."
将服务器返回的JSON string转化成字典时报错: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence ...
- 新建Oracle数据库时,提示使用database control配置数据库时,要求在当前oracle主目录中配置监听程序
新建一个oracle数据库时,当提示使用database control配置数据库时,要求在当前oracle主目录中配置监听程序等字样的时候,问题是那个监听的服务没有启动,解决方法如下: 打开cmd命 ...
- proftpd启动失败提示unable to determine IP address of “xxx.com”
proftpd启动失败提示unable to determine IP address of “xxx.com”这种proftpd启动失败的原因是无法解析后面主机的IP地址,解决方法是在DNS列表中增 ...
- AFNetworking 报3840
工作中遇到前后台交互,前端解析不了后端返回的数据格式 ,原因在于没有标准统一的请求格式 这是个坑,但是还是有办法修复 错误提示: Error Domain=NSCocoaErrorDomain Cod ...
- AFNetworking 提示"The resource could not be loaded because the App Transport Security policy requires the use of a secure connection" 解决办法
原因:iOS9以后,苹果把原http协议改成了https协议,所以不能直接在http协议下GET/POST 解决方案之一: 直接编辑工程文件下的Info.plist文件,加入以下代码 <key& ...
- WIN10系统提示无法使用内置管理员账户打开XXX应用程序怎么办
重装了系统之后,只保留Administrator账户,结果打开程序的时候回弹出这个提示 运行,输入secpol.msc 本地策略-安全选项,启用下面这个,然后重启计算机
- 登录PeopleTools 提示ora-00942表视图不存在 select xxx from sysadm.psoprdefn
起因:本来跟DBA说了把生产的库同步到CFG环境,还跟她说了,dev tst cfg在一台机器上,结果她还是把dev给覆盖了,幸好及时发现,一部分对象被删除了(序列,视图,有可能也有表). 视图和一部 ...
- (原)torch中提示Unwritable object <userdata> at <?>.callback.self.XXX.threads.__gc__
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/6549432.html 参考网址: https://github.com/torch/threads/i ...
随机推荐
- 【转】循环冗余校验(CRC)算法入门引导
原文地址:循环冗余校验(CRC)算法入门引导 参考地址:https://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks#Re ...
- SpringMVC 配置
1.在WEB-INF\web.xml中定义前端控制器 <servlet> <servlet-name>springmvc</servlet-name> <se ...
- tp5上传图片添加永久素材到微信公众号
$file = request()->file('image');if(!$file){ $res['status'] = false; $res['msg'] = '必须上传文件'; retu ...
- jstl 处理字符串
1.引入 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> ...
- 简易RPC框架-上下文
*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...
- java时间格式
Calendar startdate = Calendar.getInstance(); startdate.setTime(new Date()); //当前时间 startdate.add(Cal ...
- xml读取一行数据
#include<map>#include<iostream>#include<fstream>#include<string>using namesp ...
- Assigning Workstations
题目链接:http://vjudge.net/contest/127404#problem/A /* 给你n个数字,让你找出一个最小的数字,这个数字不在这些数字中出现的 ,注意:这个数字如果各个位上的 ...
- Treasure of the Chimp Island
Treasure of the Chimp Island Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Jav ...
- MySQL-client-5.6.36-1.linux_glibc2.5.x86_64.rpm安装详解
centos6.8已经安装了mysql,所以要卸载掉 查看命令 rpm -qa | grep mysql 注意:MySQL区分大小写 grep mysql 和grep MySQL 是不一样的!! 卸载 ...