a432511
a432511

Reputation: 1905

iPhone Objective-C JSON Parser

Has anyone had issues with a size limit on a returned JSON Object using the JSON Parser that is available for the iPhone?

I am using this open-source JSON Framework (I am using the latest version)

If I reduce the size of the returned JSON my app will run just fine. If the object gets too large, the app crashes with the below error:

-JSONValue failed. Error trace is: (
Error Domain=org.brautaset.JSON.ErrorDomain Code=3 UserInfo=0x4141580 "Unrecognised leading character"

Don't be fooled though... it has nothing to do a leading character except that it seems to split the JSON at a certain size and then ends up with a random leading character because the next JSON string starts with a random character.

Upvotes: 0

Views: 8864

Answers (1)

a432511
a432511

Reputation: 1905

Looks like I was wrong. I was trying to parse the JSON in a didReceiveData callback method, which gets called multiple times as data is received. I needed to concatenate the result as it came in and then parse the JSON in connectionDidFinishLoading.

Thanks for looking.

Upvotes: 3

Related Questions