AFNetworking3.x获得failure时候的respo
2017-11-30 本文已影响10人
小马飞驰bnb
通过失败block内的参数error取得,代码如下:
NSData *data = (NSData *)error.userInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] ;
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];