Lesson 4: Displaying data from the database

By default, the data source of a table view is its controller. In the case of this application, the RootViewController is currently the data source for the table view. In this lesson, you will implement the UITableViewDataSource protocol in the DataAccess class. This way, the DataAccess class will be responsible for providing the table view with the data it requires.

To begin, add the protocol to the DataAccess header.

@interface DataAccess : NSObject <UITableViewDataSource> {
    ULConnection *                    connection;
}
 Getting the number of names in the database
 Creating the table cells
 Setting the DataAccess object as the data source