Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 » UltraLite - C and C++ Programming » API reference » Tutorial: Build an iPhone application using the C++ API

 

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