Configuring data source methods for the table view
When your app is running, an instance of the JournalListViewController
class acts as the view controller for the Journal List screen. It is responsible for loading and displaying all the views on that screen, including the table view you added earlier. The table view needs to know how many table view cells to display and what to display in each cell. Normally, the view controller is responsible for providing this information. Apple has created a protocol, UITableViewDataSource
, for this purpose. All you need to do is set the table view’s dataSource
property to the JournalListViewController
class and implement the required methods of this protocol.
The table view also needs to know what to do if the user taps on a table view cell. Again, the view controller for the table view is responsible, and Apple has created the UITableViewDelegate
protocol for this purpose. You will set the table view’s delegate
property to...