HI guys,
I have this error that is keeping me from moving forward. I basically have an application which contains a UITabViewController which points to individual UIViewControllers. So one of the tabs, I want to implement a basic TableViewController.
Now, no matter what i do, whether its cut and paste sample UIViewController code that implements a UITableView, or whatever, or even just the default UITableViewController template from Xcode, i get the same error below:
2009-09-06 12:29:23.889 iKosher[12536:207] * -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0xe1d8d0 2009-09-06 12:29:23.891 iKosher[12536:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0xe1d8d0' 2009-09-06 12:29:23.891 iKosher[12536:207] Stack: ( 807902715, 2492915529, 808284155, ...
In IB, all I have done is drag onto the view a UITableView and set its delegates to point to the file owner.
Not sure what else i can do from here
It looks like your code is sending a tableView:numberOfRowsInSection: message to a UIViewController instance. I think it should be sending that message to an object that implements the UITableViewDataSource protocol.
Check your implementation file for the UITableViewController you are using to make sure it has the tableView:numberOfRowsInSection: method implemented (or uncommented, depending on how you generated the file).
If you have any code, post it.
I ran into this problem, the key was changing class identity in Interface Builder.
Make sure that the File's Owner object in IB is set to be an instance of the UITableViewController subclass that you're implementing, and that it has a
tableView
outlet that's linked to your table view.The issue for me was not setting the up the UITableView delegate and datasource properly.
I had these hooked up to the UITableView on my ViewController, but what I really needed was both of these hooked up to the 'Files Owner' (note I am working with xibs not storyboards).
I found the whole process to be confusing and a lot of work.
I wrote up my experiences about it here.