views:

102

answers:

2

I am working on 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..

A: 

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.

Alex Reynolds
+1  A: 

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.

Alexander Babaev
Thanks ALexander for the help. i have looked into some sample codes and was finally able to write a datacontroller for uitableviewcontroller.
Usama Ahmed