I get json from server and add them in NSMutableArray like this:
{
"title": "title60",
"summary": "summary60",
"datetime": "2013.02.03",
}
{
"id": 58,
"title": "title59",
"summary": "summary59",
"datetime": "2013.02.03",
},
{
"id": 57,
"title": "title58",
"summary": "summary58",
"datetime": "2013.02.04",
},
{
"id": 56,
"title": "title57",
"summary": "summary57",
"datetime": "2013.02.04",
},
{
"id": 55,
"title": "title56",
"summary": "summary56",
"datetime": "2013.02.05",
}
How can I use the NSMutableArray group by "datetime" and show in uitableview?
You can roll your own data structures for this, but the TLIndexPathTools library automatically sections your table when you specify a
sectionNameKeyPath
, which in this case is just going to be "datetime". I put a working example with your data up on GitHub. Try running the JSON example project. The full source of the view controller is as follows: