What I basically did was that I embedded a UITableViewController into a container in another UIView. Background is, that in a normal TableView, I would not be able to set static cells and load icons in the lines individually for each cell. I followed these steps which I found online:
My result looks like this:
The problem is now, that my Container doesn't show the content. It shows that it is a table, but basically an empty one and not the little icons or textfields which should be there. See here:
Do you guys have any suggestions what I did wrong or what can I do to show the content? If you need more information please comment. Thx for your help!
Matt
Okay I found the solution. I basically took out the tableViews datasource in EditProfileContainerTableViewController. This was the code which made the problems:
// MARK: - Table view data source
// override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// // #warning Incomplete implementation, return the number of sections
// return 1
// }
//
// override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// // #warning Incomplete implementation, return the number of rows
// return 5
// }
I added an screenshot for you guys, if anybody has a similar problem he can contact me. I'm happy to help :)
1)It might be happening because your delegate
will be tableViewController
not View controller. 2)So instead of adding tableViewController
add TableView
in ViewController
& write delegate
& datasource
methods in ViewController
You're right. Basically you can't have static cells and keep the TableView datasource section (ie by default the number of sections and number of rows per section function). When the controller loads, it will recreate dynamic cells according to these functions thus hiding your static cells
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.