lundi 23 mars 2015

Data table(iOS)

Background/Goal:


Im trying to create a "View" for iOS applications that will essentially be a table with a header and search bar.


Data for the table is downloaded from a remote server:



  • Column headers with formatting information

  • Data: JSON array of Objects that will be mapped using header data


This is how I did it on android and it works fine. The reason I use JSON is because from user to user this data may be formatted very differently.


I also need the data to be self-contained because I may have more then one table on one screen.


Clicking on any row will open detailed information on a different view.


JSON Column example:



[
{
"name": "Name",
"from": "Customer Name",
"width": 2,
"enabled": "true"
},
{
"name": "Address",
"from": "Address",
"width": 3,
"enabled": "true"
},
{
"name": "Notes",
"from": "notes",
"width": 3,
"enabled": "true"
}
]


name: Column header text


from: what key to get the data for this row from


width: weight of this column(divide by the Sum all widths to get % width)


enabled: is this field enabled?


Problem:


So I created a subclass of UITableViewController and have a xib,h,m files for this controller. but when I add a UIView or a UITableViewController to my main.storyboard it will not let me set my new subclass as the custom class.


Ive been trying to get this working for about 3 days now, watching youtube videos, reading tutorials and I can't seem to find anything similar to what Im trying to do.




Aucun commentaire:

Enregistrer un commentaire