Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Error when trying to parse stream data #11

lukef opened this Issue · 1 comment

2 participants


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.


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:

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.