Category: json

iPhone + JSON + Reflection

I’m writing an iphone application with JSON and am trying to turn JSON strings into objects (NOT Dictionaries or Arrays). In Java, thanks to Reflection, I can easily turn JSON into javabean instances like this: import net.sf.json.JSONObject; class MyBean { private String property; public String getProperty() { return property; } public void setProperty(String property) { […]

jQuery.ajax() + empty JSON object = parse error

I get a parse error when using jQuery to load some JSON data. Here’s a snippet of my code: jQuery.ajax({ dataType: “json”, success: function (json) { jQuery.each(json, function () { alert(this[“columnName”]); }); } }); I get no errors when parsing a non-empty JSON object. So my guess is that the problem is with my serializer. […]