Data Source Methods

To display a table, even a basic flat one like the one that Recipe 9-1 builds, every table data source must implement three core instance methods. These methods define how the table is structured and provide content for the table:

Image numberOfSectionsInTableViewTables can display their data in sections or as a single list. For flat tables, return 1. This indicates that the entire table should be presented as one single list. For sectioned lists, return a value of 2 or higher.

Image tableView:numberOfRowsInSection:This method returns ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.