您的位置:首页 > 移动开发 > Objective-C

详将JSONObject与JSONArray

2016-07-11 23:21 513 查看
JsonObject说白了就是一个键值对,JSINArray就使用(“[ ] ”)中括号括起了很多个键值对,就是一个数组里面有很多个键值对。

1.处理JSONObject与JSONArray

Strng string=   “poid”:

                                 String str = null;
JSONObject jsonObject = new JSONObject();
JSONArray json = new JSONArray();
jsonObject = jsonObject.fromObject(string);
System.out.println(jsonObject.get("pois"));
json = JSONArray.fromObject(jsonObject.get("pois"));

System.out.println(jsonObject.toString());
for (int i = 0; i < json.toArray().length; i++)
{
jsonObject = json.getJSONObject(i);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  json