这个是我发布的webservice的数据
[{"ID":1,"Name":"元台禅寺","Url":"spotPic/元台禅寺.jpg","LineID":1},{"ID":2,"Name":"田坞里山塘","Url":"spotPic/田坞里山塘.jpg","LineID":1},{"ID":3,"Name":"滴水石","Url":"spotPic/滴水石","LineID":1},{"ID":4,"Name":"青蛙石","Url":"spotPic/青蛙石","LineID":1},{"ID":5,"Name":"平安石","Url":"spotPic/平安石","LineID":1},{"ID":6,"Name":"小五桥","Url":"spotPic/小五桥","LineID":2},{"ID":7,"Name":"大林口子","Url":"spotPic/大林口子","LineID":2},{"ID":8,"Name":"跳断廊","Url":"spotPic/跳断廊","LineID":1},{"ID":9,"Name":"梅子树","Url":"spotPic/梅子树","LineID":1},{"ID":10,"Name":"300年古树","Url":"spotPic/300年古树","LineID":1},{"ID":11,"Name":"林海亭","Url":"spotPic/林海亭","LineID":1},{"ID":12,"Name":"岩山景区","Url":"spotPic/岩山景区","LineID":1},{"ID":13,"Name":"石岗头","Url":"spotPic/石岗头","LineID":1},{"ID":14,"Name":"佛堂村石碑","Url":"spotPic/佛堂村石碑","LineID":2},{"ID":15,"Name":"小瀑布","Url":"spotPic/小瀑布","LineID":1},{"ID":16,"Name":"一线天","Url":"spotPic/一线天","LineID":2},{"ID":17,"Name":"大斗坞水库","Url":"spotPic/大斗坞水库","LineID":1},{"ID":18,"Name":"老鹰石观景点","Url":"spotPic/老鹰石观景点","LineID":2},{"ID":19,"Name":"仙人洞","Url":"spotPic/仙人洞","LineID":1},{"ID":20,"Name":"山顶观景点","Url":"spotPic/山顶观景点","LineID":1},{"ID":21,"Name":"红旗山塘","Url":"spotPic/红旗山塘","LineID":2}]
通过NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers) as? NSDictionary解析得到
{
d = "[{\"ID\":1,\"Name\":\"\U5143\U53f0\U7985\U5bfa\",\"Url\":\"spotPic/\U5143\U53f0\U7985\U5bfa.jpg\",\"LineID\":1},{\"ID\":2,\"Name\":\"\U7530\U575e\U91cc\U5c71\U5858\",\"Url\":\"spotPic/\U7530\U575e\U91cc\U5c71\U5858.jpg\",\"LineID\":1},{\"ID\":3,\"Name\":\"\U6ef4\U6c34\U77f3\",\"Url\":\"spotPic/\U6ef4\U6c34\U77f3\",\"LineID\":1},{\"ID\":4,\"Name\":\"\U9752\U86d9\U77f3\",\"Url\":\"spotPic/\U9752\U86d9\U77f3\",\"LineID\":1},{\"ID\":5,\"Name\":\"\U5e73\U5b89\U77f3\",\"Url\":\"spotPic/\U5e73\U5b89\U77f3\",\"LineID\":1},{\"ID\":6,\"Name\":\"\U5c0f\U4e94\U6865\",\"Url\":\"spotPic/\U5c0f\U4e94\U6865\",\"LineID\":2},{\"ID\":7,\"Name\":\"\U5927\U6797\U53e3\U5b50\",\"Url\":\"spotPic/\U5927\U6797\U53e3\U5b50\",\"LineID\":2},{\"ID\":8,\"Name\":\"\U8df3\U65ad\U5eca\",\"Url\":\"spotPic/\U8df3\U65ad\U5eca\",\"LineID\":1},{\"ID\":9,\"Name\":\"\U6885\U5b50\U6811\",\"Url\":\"spotPic/\U6885\U5b50\U6811\",\"LineID\":1},{\"ID\":10,\"Name\":\"300\U5e74\U53e4\U6811\",\"Url\":\"spotPic/300\U5e74\U53e4\U6811\",\"LineID\":1},{\"ID\":11,\"Name\":\"\U6797\U6d77\U4ead\",\"Url\":\"spotPic/\U6797\U6d77\U4ead\",\"LineID\":1},{\"ID\":12,\"Name\":\"\U5ca9\U5c71\U666f\U533a\",\"Url\":\"spotPic/\U5ca9\U5c71\U666f\U533a\",\"LineID\":1},{\"ID\":13,\"Name\":\"\U77f3\U5c97\U5934\",\"Url\":\"spotPic/\U77f3\U5c97\U5934\",\"LineID\":1},{\"ID\":14,\"Name\":\"\U4f5b\U5802\U6751\U77f3\U7891\",\"Url\":\"spotPic/\U4f5b\U5802\U6751\U77f3\U7891\",\"LineID\":2},{\"ID\":15,\"Name\":\"\U5c0f\U7011\U5e03\",\"Url\":\"spotPic/\U5c0f\U7011\U5e03\",\"LineID\":1},{\"ID\":16,\"Name\":\"\U4e00\U7ebf\U5929\",\"Url\":\"spotPic/\U4e00\U7ebf\U5929\",\"LineID\":2},{\"ID\":17,\"Name\":\"\U5927\U6597\U575e\U6c34\U5e93\",\"Url\":\"spotPic/\U5927\U6597\U575e\U6c34\U5e93\",\"LineID\":1},{\"ID\":18,\"Name\":\"\U8001\U9e70\U77f3\U89c2\U666f\U70b9\",\"Url\":\"spotPic/\U8001\U9e70\U77f3\U89c2\U666f\U70b9\",\"LineID\":2},{\"ID\":19,\"Name\":\"\U4ed9\U4eba\U6d1e\",\"Url\":\"spotPic/\U4ed9\U4eba\U6d1e\",\"LineID\":1},{\"ID\":20,\"Name\":\"\U5c71\U9876\U89c2\U666f\U70b9\",\"Url\":\"spotPic/\U5c71\U9876\U89c2\U666f\U70b9\",\"LineID\":1},{\"ID\":21,\"Name\":\"\U7ea2\U65d7\U5c71\U5858\",\"Url\":\"spotPic/\U7ea2\U65d7\U5c71\U5858\",\"LineID\":2}]";
}
let a = json.objectForKey("d") print(a)得到
Optional([{"ID":1,"Name":"元台禅寺","Url":"spotPic/元台禅寺.jpg","LineID":1},{"ID":2,"Name":"田坞里山塘","Url":"spotPic/田坞里山塘.jpg","LineID":1},{"ID":3,"Name":"滴水石","Url":"spotPic/滴水石","LineID":1},{"ID":4,"Name":"青蛙石","Url":"spotPic/青蛙石","LineID":1},{"ID":5,"Name":"平安石","Url":"spotPic/平安石","LineID":1},{"ID":6,"Name":"小五桥","Url":"spotPic/小五桥","LineID":2},{"ID":7,"Name":"大林口子","Url":"spotPic/大林口子","LineID":2},{"ID":8,"Name":"跳断廊","Url":"spotPic/跳断廊","LineID":1},{"ID":9,"Name":"梅子树","Url":"spotPic/梅子树","LineID":1},{"ID":10,"Name":"300年古树","Url":"spotPic/300年古树","LineID":1},{"ID":11,"Name":"林海亭","Url":"spotPic/林海亭","LineID":1},{"ID":12,"Name":"岩山景区","Url":"spotPic/岩山景区","LineID":1},{"ID":13,"Name":"石岗头","Url":"spotPic/石岗头","LineID":1},{"ID":14,"Name":"佛堂村石碑","Url":"spotPic/佛堂村石碑","LineID":2},{"ID":15,"Name":"小瀑布","Url":"spotPic/小瀑布","LineID":1},{"ID":16,"Name":"一线天","Url":"spotPic/一线天","LineID":2},{"ID":17,"Name":"大斗坞水库","Url":"spotPic/大斗坞水库","LineID":1},{"ID":18,"Name":"老鹰石观景点","Url":"spotPic/老鹰石观景点","LineID":2},{"ID":19,"Name":"仙人洞","Url":"spotPic/仙人洞","LineID":1},{"ID":20,"Name":"山顶观景点","Url":"spotPic/山顶观景点","LineID":1},{"ID":21,"Name":"红旗山塘","Url":"spotPic/红旗山塘","LineID":2}])