私はYouTubeのプレイリストを解析しようとしています:iOS 5 Google JSON - ネストされたオブジェクトを解析する方法
私のJSONが同じように構成されている場合:私は完璧を経由してタイトルを解析することができる午前
{"apiVersion" ....
"items":[{"id2":"some-id","title":"songtitle",
:
// Fill array
NSArray *items = [json objectForKey:@"items"];
// Get item from tableData
NSDictionary *item = [tableData objectAtIndex:[indexPath row]];
// Set text on textLabel
[[cell textLabel] setText:[item objectForKey:@"title"]];
しかし、JSON場合次のようになります。
{"apiVersion" ....
"items":[{"id1": .... "video":{"id2":"some-id","title":"songtitle",
ネストされたオブジェクトにどのように到達できますかCTタイトル?
単なる簡単なことですが、私は今これについて何時間も頭を叩いています。あなたの提案に感謝します。
[EDIT] は、これは完全な構造です:
{
"items":
[
{
"video":
{
"title": "Number One",
"description": "Description one"
},
{
"title": "Number two",
"description": "Description two"
},
{
"title": "Number three",
"description": "Description three"
}
},
{
"video":
{
"title": "Number One",
"description": "Description one"
},
{
"title": "Number two",
"description": "Description two"
},
{
"title": "Number three",
"description": "Description three"
}
}
]
}
あなたの全体のJSONを表示することができますこのように少し混乱しています。 –