- What data source link is the author talking about
2)Again what table view is the author referring to here
3)If the table view wants to know how many rows of data it has , from where it will know and which table view is it , is it. the method table view or the arguments inside. the method table view
- Once it is hooked up to a data source – i.e. your view controller – the table view , this line is very confusing which data source got hooked to which tableview , how is the controller doing all this ?
“The data source is the link between your data and the table view. Usually, the view controller plays the role of data source and implements the necessary methods. So, essentially, the view controller is acting as a delegate on behalf of the table view. (This is the delegate pattern that we’ve talked about before - where an object does some work on behalf of another object.)
The table view needs to know how many rows of data it has and how it should display each of those rows. But you can’t simply dump that data into the table view’s lap and be done with it. You don’t say: “Dear table view, here are my 100 rows, now go show them on the screen.”
Instead, you say to the table view: “This view controller is now your data source. You can ask it questions about the data anytime you feel like it.”
Once it is hooked up to a data source – i.e. your view controller – the table view sends a numberOfRowsInSection message to find out how many data rows there are.
And when the table view needs to draw a particular row on the screen it sends a cellForRowAt message to[…]”