本文介绍了如何从AFNetworking和AFJSONRequest操作中获取可变字典?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用JSONKit与AFNetworking的AFHTTPClient(与AFJSONRequestOperation),我似乎不知道如何可能触发使用mutableObjectFrom ... JSONKit的方法,而不是正常的解析器方法返回(或数组解决方案
没有修改AFNetworking
在AFJSONUtilities.m更改(第103行)
<$> p $ p>
SEL _JSONKitSelector = NSSelectorFromString(@objectFromJSONDataWithParseOptions:error:);
由
SEL _JSONKitSelector = NSSelectorFromString(@mutableObjectFromJSONDataWithParseOptions:error:);
I'm using JSONKit with AFNetworking's AFHTTPClient (with AFJSONRequestOperation) and I can't seem to figure out how one might trigger the use of the mutableObjectFrom... methods of JSONKit rather than the normal parser methods which return (or arrays of) JKDictionary.
Is this possible without modifying AFNetworking?
解决方案
You can't do that without editing AFNetworking code.
In AFJSONUtilities.m change (line 103)
SEL _JSONKitSelector = NSSelectorFromString(@"objectFromJSONDataWithParseOptions:error:");
By
SEL _JSONKitSelector = NSSelectorFromString(@"mutableObjectFromJSONDataWithParseOptions:error:");
这篇关于如何从AFNetworking和AFJSONRequest操作中获取可变字典?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!