Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error when trying to parse stream data #11

Open
lukef opened this Issue · 1 comment

2 participants

@lukef

Whenever I try to parse a stream of data using ASIHTTPRequest I get the following error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFDictionary initWithObjects:forKeys:count:]: attempt to insert nil value at objects0'

The method that fails is 'yajl_lex_lex'. It looks like the code is showing an invalid char no matter what get's fed in.

The code I used is simple:
YAJLDocument *jsonDoc = [[[YAJLDocument alloc] init] retain]; // defined globally

  • (void)request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data { NSError *error = nil; YAJLParserStatus status = [jsonDoc parse:data error:&error]; }

No matter what JSON data I try, same error. If I parse on completion, the data parses fine.

@cspickert

In case you're still having this problem: are your responses gzip compressed? If so, you need to set the following:

[request shouldWaitToInflateCompressedResponses:NO]

By default, responses are not inflated on the fly. See this portion of the ASIHTTPRequest documentation: http://allseeing-i.com/ASIHTTPRequest/How-to-use#on-the-fly_inflating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.