I need help using UITableView Controller sub class. How should i populate the tableview with my values?
I am working on 开发者_JAVA技巧a view-based project. My first view is a UIView where i fetch my data. Then i add a subview to my window which is a UITableView. Now i am unable to populate my data to UITableView. Please help..
There are two properties in UITableView, that are called delegate and dataSource. They can be bind on any object that implements specific protocol (UITableViewDelegate and UITableViewDataSource). Second object (DataSource) is what you need. It has all the callbacks for populating table rows/sections.
By default these properties are bind to a UITableViewController instance. But you can change that.
This is not something that can be easily answered in a paragraph or two. You would do well to thoroughly read through Apple's Table View Programming Guide to understand how the UITableView
and its data controller and delegate methods are used. This is an excellent overview of how this class works.
精彩评论