Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use a UITableView without a UITableViewController

I want to use a UITableView as a single selection in my own ViewController, now I can display it but fail to fill the cell or get wrong on how to fill the cell's textlabel. Any suggestion? ...

like image 313
anna Avatar asked Apr 21 '12 11:04

anna


1 Answers

Implement the protocols for UITableViewDataSource, UITableViewDelegate in .h or .m then connect the tableview with the first responder -datasource and -delegate in interface builder and support the protocol required classes in your .m.

For datasource it is: cellForRowAtIndexPath and numbersOfRowsInSection.

Set your cell.textlabel.text in your cellForRowAtIndexPath method.

like image 189
Quirin Avatar answered Dec 11 '22 00:12

Quirin