我的WS返回簡單的JSON這樣的:如何從json保存在nsstring中獲取一些值?
{
"thumbnail_url": "http://something.com/photos/003/582/test-tiny.jpg?1321956139",
"success": true,
"photo_url": "http://something.com/photos/003/582/test-medium.jpg?1321956139",
"big_photo_url": "http://something.com/photos/003/582/test-big.jpg?1321956139"
}
我得到這個NSData的從NSURLConnection的。我知道如何從NSData製作NSString。我想爲「photo_url」鍵獲得價值。
它如何做到這一點?
我會sugest [JSONkit(https://github.com/johnezang/JSONKit),因爲它是那裏的齋戒之物。這裏是解析JSON的一些很好的信息:http://triplesoftware.nl/2011/08/json-parsing/ – rckoenes