2012-07-11 37 views
0

我有一個應用程序,我從web服務獲得這樣的響應。誰能告訴我如何分析這使其作爲單獨的字符串"Info":如何解析數組?

{ 
    "name":"gdgdgdgd", 
    "desc":"Cosmopolitan life, adventurous outlook, 'been there done that' attitude, and yet the way the life ...", 
    "address1":" 2nd A Main ", 
    "address2":" Layout," 
}, 
+2

使用NSJSONSerialization。 – nhahtdh 2012-07-11 05:26:31

+0

你有這個工作嗎? – bryanmac 2012-09-01 13:05:03

回答

-1

這樣做使用json庫

NSMutableDictionary * listd = [dict objectForKey:@「merchantInfo」];

if([listd isKindOfClass:[NSDictionary class]]) 

{ 

    stringshopname=[listd objectForKey:@"name"]; 
    stringshopdesc=[listd objectForKey:@"desc"]; 


}