I have been trying to find a tutorial to do the following:
I have a UITableViewController with two sections with 1 row per section.
The row in the second section shows a list of items which are just a list of strings (like a basic UITableView with the Basic cell type).
So basically, if I have 2 items to list in the UITableViewCell, I would like to create a UITableView in its contentView with 1 section and 2 rows, each row having a UILabel for me to access.
Can anyone point me in the right direction?
Thanks!
In principle, I think you should abandon your idea with table view inside table view. The outer table view will scroll, and the inner one also, resulting in a very confusing and potentially frustrating user experience. The standard setup for what you describe (master detail) is to present the detail in a separate table view that animates in and out; or to divide your table view into sections with the data (using the sections below for the additional data you mention).
If you want to proceed with your idea, you should be able to explain, why the user has to see the second section while scrolling the first section. I think it will be very hard to argue.
That being said, it is of course possible to include a table view in a table view cell. Simply drag the table view into the cell in interface builder, give it a unique name, wire it up with your controller (delegate and datasource) and make sure you distinguish between the outer and inner table views in your delegate and datasource methods.
For example,