美文网首页
[_NSInlineData objectForKeyedSub

[_NSInlineData objectForKeyedSub

作者: TUNIANL | 来源:发表于2017-01-07 10:59 被阅读0次

reason: '-[_NSInlineData objectForKeyedSubscript:]: unrecognized selector sent to instance 0x7fa2049bf220'

原因是 后台设置的JSON字符和AFNetWorking解析的不一致

1.用 AFNetworking 进行数据处理的时候 加上`manager.responseSerializer= [AFJSONResponseSerializer serializer];`

2.在数据解析成功的方法里加上

NSString*result = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];

NSDictionary * dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil];

NSLog(@"result1 = %@", result);

NSLog(@"dic = %@",dic);

相关文章

网友评论

      本文标题:[_NSInlineData objectForKeyedSub

      本文链接:https://www.haomeiwen.com/subject/hdkhettx.html