How to use UITableView without UITableViewController

I want to use UITableView as a separate selection in my own ViewController, now I can display it, but I could not fill the cell or I did not understand how to fill the text label of the cell. Any suggestion?...

+5
source share
3 answers

Implement the protocols for UITableViewDataSource, UITableViewDelegatein .hor .m, then connect the tableview with the first responder -datasourceand -delegatein the interface builder and maintain the necessary protocols in yours .m.

For a data source, these are: cellForRowAtIndexPathand numbersOfRowsInSection.

Set cell.textlabel.textto your cellForRowAtIndexPathmethod.

+15
source

, . ,

0

You can embed the TableViewController in your ViewController (property) and add the TableViewControllers view to the ViewControllers (addSubView). Creating cells goes to the TableViewController and works the same way as in the usual case.

0
source

All Articles