UITableView without <UITableViewDelegate, UITableViewDataSource> still works!

I read that whenever you use UITableView, you must map your controller class to the protocols <UITableViewDelegate, UITableViewDataSource>(unless you use the tailormade class UITableViewController).

So my superclass is UIViewController, but I forgot to add an ad <UITableViewDelegate, UITableViewDataSource>in the .h file. For some reason, the table works anyway. It gets its data from the class and clicks the cells, as expected.

Can someone explain this to me - why does it work?

+3
source share
1 answer

, . , , , UITableViewDelegate UITableViewDataSource, , .

, , . ViewController , , , , UITableViewDataSourceDelegate.

+8

All Articles