json - AFNetworking get responseObject in failure block -
i get
json data server, json data has line break "\n", got error:
error domain=nscocoaerrordomain code=3840 "the operation couldn’t completed. (cocoa error 3840.)" (unescaped control character around character 2333.) userinfo=0x7fa054a02ab0 {nsdebugdescription=unescaped control character around character 2333.}
so want find where's broken json data, escape first , parse it. can't find response data is.
any help?
edited:
if let d = error.userinfo { println(d) println(d[afnetworkingoperationfailingurlresponsedataerrorkey]) }
i tried in failure block, d[afnetworkingoperationfailingurlresponsedataerrorkey] prints nil
you can response data nserror of failure block:
nsdata *errordata = [error.userinfo objectforkey:afnetworkingoperationfailingurlresponsedataerrorkey];
from that, may transform nsstring or else need escape , process appropriately.
Comments
Post a Comment