Iphone: TabView + TableView
- by OneTrickPonySoft
I think I'm missing something simple, but I can't figure out exactly what it is.
I'm trying to set up an App with a UITabViewController, and one of the Tabs will have a UITableView and UISearchBar (but no Navigation Controller). I set up the UITabViewController with all the tabs in interface builder, and the views are in their own xib files. The xib file for the tab with the UITableView is set up and connected as follows.
Stuff in the browser:
File's owner (Class is my custom class that is a child of UITableViewController) view - View
View (class UIView, reference view - File's owner) contains:
UITableView (if i try and set references to the data source / delegate, the app breaks)
UISearchBar (unconfigured at the moment)
This setup displays all the items and doesn't lock up, but I can't assign a DataSource without it crashing when i try and load the tab with the UITableView. What should I do to get data into this table, either in IB or code? My ideas are as follows:
Implement custom UITableView class, hook up to table view in IB or to custom tableviewcontroller in Xcode.
Pound head or laptop against the wall until it works.
Update:
Here's the error the simulator pushes to the console when I connect the Tableview's data source and delegate to File Owner (who's class is my custom tableviewcontroller).
2/14/09 6:59:12 PM TabBarWillbeRight[33172] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x523760'