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

SQL Anywhere 12.0.1 » UltraLite - C and C++ Programming » Tutorials » Tutorial: Building 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 implement the UITableViewDataSource protocol in the DataAccess class. This way, the DataAccess class is responsible for providing the table view with the data it requires.

To begin, add the UITableViewDataSource protocol to the interface.

@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
 Build and run the application