In the Calling Optional Methods section, the book says “To avoid this situation, the table view asks first to see if its data source implements numberOfSectionsInTableView:.”
Where does this actually occur in code?
In the Calling Optional Methods section, the book says “To avoid this situation, the table view asks first to see if its data source implements numberOfSectionsInTableView:.”
Where does this actually occur in code?
I think the particular code for the situation you quoted is built in to the protocol, so that if you don’t specify number of sections, the number of sections is automatically rendered one, by default; avoiding a crash.
But otherwise they show us how you would ask if you wanted to, as in via the respondsToSelector: method, which they use in the context of the built-in code (which is prob why it is confusing).
It is learned that good up here. I want to know something like this in my life.