ios开发之--[_NSInlineData objectForKeyedSubscript:]

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

项目调试报错,差了下是因为解析格式不一致导致的,解决方法如下:

1.用 AFNetworking 进行数据处理的时候 加上

manager.responseSerializer= [AFJSONResponseSerializer serializer];

2.在返回的response里面加上解析方法,如下:

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

然后,就可以正常使用了!

原文地址:https://www.cnblogs.com/hero11223/p/9360699.html