是這樣的內容...解析JSON把所有的內容在一個NSArray中
[
{
"id": "",
"title": "",
"website": "",
"categories": [
{
"id": "",
"label": ""
}
],
"updated":
},
{
"id": "",
"title": "",
"website": "",
"categories": [
{
"id": "",
"label": ""
}
],
"updated":
}
]
我怎樣才能插入一個陣列中每一個的供應源?
NSDictionary *results = [string JSONValue];
NSArray *subs = [results valueForKey:@"KEY"];
我必須插入哪個鍵? 感謝
你有一個字典數組。您必須以某種方式迭代數組以從字典中提取值。它非常簡單,只需查看結構並瞭解代碼必須與結構匹配。花5分鐘時間在json.org上學習JSON語法,以便理解它。 –
當然,您已經編輯了上述JSON,使其不再有效。 –