我有兩個數組。對於區段說A
,並在其內部陣列B
行。我如何訪問它們以顯示numberOfRowsInSection
以及關於要在單元格中顯示的部分的行。如何解析給定的JSON數據在目標c中並顯示在表格單元格
我的JSON如下:
{
"data": {
"claims": [{
"id": "64",
"first_name": "Alia",
"last_name": "Bhatt",
"vendorimage": "http://projects.kleward.com/salesaward/beta1.5/public/profileImage/img1445325413.jpeg",
"claimlist": [{
"campaign_end_date": "2016-10-31",
"days": "362",
"promotion_id": "7",
"promotion_name": "Promotion 1 Jeans",
"promotion_description": " Promotion Description Promotion Description Promotion Description Promotion Description Promotion Description Promotion Description Promotion Description Promotion Description Promotion Description Promotion Description Promotion Descripti",
"totalClaim": "1",
"totatAmount": "200.00000"
}]
}, {
"id": "65",
"first_name": "Life",
"last_name": "Style",
"vendorimage": "http://projects.kleward.com/salesaward/beta1.5/public/profileImage/img1445331248.jpg",
"claimlist": [{
"campaign_end_date": "2016-11-23",
"days": "385",
"promotion_id": "9",
"promotion_name": "Promotion 3 Wrist Watch",
"promotion_description": "Promotion 3 Wrist Watch Description",
"totalClaim": "1",
"totatAmount": "300.00000"
}]
}, {
"id": "76",
"first_name": "Snap",
"last_name": "Deal",
"vendorimage": "http://projects.kleward.com/salesaward/beta1.5/public/profileImage/img1445851551.png",
"claimlist": [{
"campaign_end_date": "2016-12-29",
"days": "421",
"promotion_id": "10",
"promotion_name": "Dell Promotion",
"promotion_description": "Dell Promotion Description",
"totalClaim": "1",
"totatAmount": "50.00000"
}, {
"campaign_end_date": "2016-12-30",
"days": "422",
"promotion_id": "16",
"promotion_name": "Mac Promotion",
"promotion_description": "Mac Promotion Description",
"totalClaim": "1",
"totatAmount": "150.00000"
}]
}]
}
}
開始與NSJSONSerialization,然後編寫代碼。這就是其他人所做的。 – gnasher729