//iOS 去除JSON里的转义字符
// 首先将返回格式设为二进制格式
manager.responseSerializer = [AFHTTPResponseSerializerserializer];
// 其次第一种方法去除转义字符
NSString * str = [[NSStringalloc]initWithData:responseObjectencoding:NSUTF8StringEncoding];
NSMutableString * responseString = [NSMutableStringstringWithString:str];
NSString *character = nil;
for (int i =0; i < responseString.length; i ++) {
character = [responseString substringWithRange:NSMakeRange(i,1)];
if ([character isEqualToString:@"\\"])
[responseString deleteCharactersInRange:NSMakeRange(i,2)];
}
NSData * data = [responseStringdataUsingEncoding:NSUTF8StringEncoding];
NSDictionary * dataDic = [NSJSONSerializationJSONObjectWithData:data options:NSJSONReadingMutableContainerserror:nil];
// 第二种方法去除转义字符
NSString * str = [[NSStringalloc] initWithData:responseObjectencoding:NSUTF8StringEncoding];
str = [str stringByReplacingOccurrencesOfString:@"\r\n"withString:@""];
str = [str stringByReplacingOccurrencesOfString:@"\n"withString:@""];
str = [str stringByReplacingOccurrencesOfString:@"\t"withString:@""];
// str = [str stringByReplacingOccurrencesOfString:@"\\" withString:@""];
NSData * data = [strdataUsingEncoding:NSUTF8StringEncoding];
NSDictionary * dataDic = [NSJSONSerializationJSONObjectWithData:data options:NSJSONReadingMutableContainerserror:nil];