The UITableView has built in functionality to draw itself.
The UITableViewDataSource Protocol methods are called by the tableView and provide information about size.
Required protocol methods as implemented in the project:
Code:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
//return 10;
return[listOfMovies count];
}
The (numberOfSections * numberOfRows) informs the tableView how many times it will call
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPathâ¦
which provides the information for each cell.
The tableView will automatically load the data when the view is displayed, updates are sometimes handled with -reloadData. Other updates such as insertion and deletion are handled differently. The documentation covers this.
Bob