I got the same problem and found the solution for my code. When connection returns large data method "didReceiveData" calls many time with the chunk of data recieved. We have to append the data of this method to NSData reference declared in .h file of the parser class. And should call the method "dictionaryWithJSONData" in the delegate method of NSURLConnection "connectionDidFinishLoading".
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[self.dataJSON appendData:data];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
NSDictionary *dictionary = [NSDictionary dictionaryWithJSONData:dataJSON];
}
Here dataJSON is declared at .h file and allocated in the init method.