Open PeyloW opened 13 years ago
This sounds similar to an issue I encountered here: http://github.com/mattgemmell/MGTwitterEngine/issues#issue/31
My YAJL parser parse geo, but when I did search i had sometging this:
2011-10-30 19:23:28.716 TwitterApp[4719:207]({
"completed_in" = "0.048";
"max_id" = 130690871812296704;
"max_id_str" = 130690871812296704;
"next_page" = "?page=3&max_id=130690871812296704&q=&geocode=48.036%2C37.7664%2C50mi&rpp=100";
page = 2;
"previous_page" = "?page=1&max_id=130690871812296704&q=&geocode=48.036%2C37.7664%2C50mi&rpp=100";
query = "";
"refresh_url" = "?since_id=130690871812296704&q=&geocode=48.036%2C37.7664%2C50mi";
results = {
"created_at" = "Sun, 30 Oct 2011 17:01:46 +0000";
"from_user" = AveLOVElovE;
"from_user_id" = 289967312;
"from_user_id_str" = 289967312;
geo = "
But must had 100 tweets! Can help me?
The Search YAJL Parser assumes that there is only one, and ever one array in the JSON response. As we all know; asumption is the mother of all disasters.
A tweet with a geo location in it can have an array with locations in the WGS84 coordinate system, like this: "geo" : { "type" : "Point", "coordinates" : [55.592, 13.0087] }
This line will mark the parser as "not inside array", and any data following will be corrupted.
I have solved the problem in my app by letting startArrayWithKey: and endArray always call super, where an arrayDepth is kept. Then I removed insideArray ivar, and instead check for (arrayDepth == 1).
This is also an ugly hack, since subarrays will just be ignored.