Ok I am making a call to a web service to get policies back. The user can have multiple policies, and these policies are to have there own table (Please note not there own section in a table). These tables can have an unknown number of rows in them all depending on the number of amendments to the policy plus the policy itself. So I need to dynamically generate the tables for this onto a UIScrollView. Does anyone know how I can do this? If you don’t understand me then please ask.
Share
You can create UITableViews programmatically with
then set the view controller to be the delegate and data source of the table view:
and add the table view to your scroll view like such:
and in order to keep track of the table views, you can use the tag associated with each one. These are probably best defined as constants at the top of your .m file. You can name them appropriately so you know what policy the table view is supposed to be for. For example, at the top of your .m file:
and then when creating the table view:
then, when dealing with any of the delegate or data source methods, check the tag so you know which one you are dealing with. For example: