一、先去掉转移‘/’
NSMutableString *responseString = [NSMutableString stringWithString:@"xxxxxxx"];
NSString *character = nil;
for (int i = 0; i < responseString.length; i ++) {
character = [responseString substringWithRange:NSMakeRange(i, 1)];
if ([character isEqualToString:@"\\"])
[responseString deleteCharactersInRange:NSMakeRange(i, 1)];
}
二、转字典
NSData *jsonData = [responseString dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:nil];
网友评论