tableView:numberOfRowsInSection:]: unrecognized selector sent to instance
Read what the error message is telling you!
You have implemented
numberOfRowsInSection:. So what? That's the wrong method. It is irrelevant. It will never be called.
The method you need to implement is called
tableView:numberOfRowsInSection:. That's completely different.
If you click on the view it should show the above connections in INSPECTOR.If you haven't got the ViewController hooked up as well you will get the error:
'NSInvalidArgumentException', reason: '-[UIView tableView:numberOfRowsInSection:]: unrecognized selector sent to instance
How I stopped the error is you
- press on the ViewController to select it
- look for Referencing Outlets in the Connection inspector to the right
- drag from the circle of the New Referencing Outlet to the view
- when you release the mouse, a tiny popup will show - select datasource
- repeat step 3, and this time select delegate
When done, it should look like the image below!
This stopped the above error for me.I hope this helps someone.