I am new to iPhone development, having just gone thru the Mark-LaMarche book.
The application is a tab-bar app, with each of the tabs in turn linking to a navigation controller, each in their own nib.
The problem I am facing is this. On the Navigation Controllers that are extensions of UIViewControllers (let's call one myNavRootController), I still have to insert a table on PART of the view.
So I created another extension of a UITableViewController (let's call it mySmallTableController), and then dropped a Table View using the Interface Builder on top of the View associated with myNavRootController. How do I link this Table to mySmallTableController?
Alternatively, I dropped a Table View Controller into the NIB, and linked its class to mySmallTableController. This controller has its own Table View. How do I make this table view show up on the View of the myNavRootController?
Your help much appreciated. I am heavily relying on IB, since my Objective-C skills are nascent.
The only alternative I can think of is to make the whole myNavRootController View a grouped table view with two sections, show the rows in the top section, and make the bottom section one giant row where I can place other controls as needed by implementing a custom cell view from a new nib.
Some progress. I changed the myNavRootController declaration to support <UITableViewDelegate, UITableViewDataSource>, copied some methods from a "normal" Table View Controller (mySmallTableController), and in IB, pointed the dataSource and delegate of the Table View within the View associated with myNavRootController to point to the File Owner. So far the cells are showing up fine
Some progress. I changed the myNavRootController declaration to support <UITableViewDelegate, UITableViewDataSource>, copied some methods from a "normal" Table View Controller (mySmallTableController), and in IB, pointed the dataSource and delegate of the Table View within the View associated with myNavRootController to point to the File Owner. So far the cells are showing up fine
gtur,
I just figured this out today. What I did is to create a custom UITableViewController class. I created a UITableViewController at the root level of my nib, and set it's type to my custom controller class.
I deleted the table view object that IB creates inside the controller. Then I dragged a table view object onto the view where I wanted it. Finally, I connected up the delegate and data source outlets from the table view to the controller, and then set the view outlet of the controller to point to the view. It works.