objective c - Obj-C/iOS is a data structure like a plist okay or is something like coredata more easily used? -
i'm looking build reporting system, have canned reports, , user created reports, each report i'll need name, description, , information contain below structure i've jsonlint'ed represent data single report called "review progress" (inside canned report structure) need.
{ "canned": [ { "name": "review progress", "description": "quick @ ...", "contents": { "collections": [], "filters": [], "facets": { "review status": [ { "reviewed": { "value": "300", "enabled": "true" } }, { "not reviewed": { "value": "150", "enabled": "false" } } ] } } } ]
}
am barking wrong tree here creating series of dictionaries , arrays accessing items inside of setting tableview start this?
cell.textlabel.text = self.reports[indexpath.section][@"reports"][indexpath.row][@"name"];
would suggest different approach coredata/some sort of db instead ease? ask users able create own reports have have same data.
a quick way should use json accelerator (free) generate object models form json.
and add "top" generated class model category provided repository:
https://github.com/psineur/nsobject-automagiccoding
to load/save dictionary representation (i.e. plist/json structured data) document folder
this quite same
cell.textlabel.text = self.reports[indexpath.section][@"reports"][indexpath.row][@"name"];
but more cleaner in opinion object models
Comments
Post a Comment