Hi all, I’m running into some difficulty understanding Ch11. I’m hoping someone can help.
- In what appears to be page 246 of my ebook, there is a paragraph that says:
“Now you will implement tableView(_:commit:forRow:), a method from the UITableViewDataSource protocol. (This method is called on the ItemsViewController. ”
What does “this method is ‘called on’ the ItemsViewController” mean? Who calls it? When does it get called? Where is this documented? I don’t understand what this is saying, and what it means. ItemsViewController is the table view’s dataSource? Is this set somewhere, or is this implied?
- A little earlier on this page it says:
“Before the table view will delete a row, it calls a method on its data source about the proposed deletion and waits for confirmation.”
I don’t understand what it means that the tableView called a method on its dataSource and waits for confirmation. Is this something that is triggered by the code that I entered, or is this something that the class just knows how to do? Where is this confirmation documented? Is there another way to do the confirmation? Where in the code does the confirmation actually take place?
I think I am getting confused when the writers personify the objects, but are not clear about which actions we are triggering in code, versus which ones the classes automatically handle. A drawing would be helpful.
I already plan on reading Ch10 and 11 again, but thought I would post this question since someone else might have it as well.