views:

445

answers:

1

Do I need a UITableViewController in addition to my UIViewController if I want to load a UITableView as a subview along with several other views at one time?

+1  A: 

No, just make your UIViewController the data source and delegate of the UITableView subview, and make sure the UIViewController adopts the appropriate protocols in the header file.

No Surprises
That's what I thought. The only problem is that the view gets loaded in my MainWindow.xib.
Adam
If I connect the dataSource and delegate to the "File's Owner" that's the UIApplication which I've gathered I can't do. Just not sure how to wire it then.
Adam
I think the answer from No Surprises is correct, that's the way I always do it - have never used a UITableViewController because of the fixed size and UIViewController is just as easy once you have code to copy and paste. The easy way to solve your problem is just to create a UIViewController that is loaded by your application delegate and have it as the File's Owner, and manager, of your first screen. Typically I only have core data init, nav controller creation etc. in the app delegate.
Adam Eberbach
Adam: If you poke around below the navigation controller, you should eventually find an instance of your view controller. Connect the two outlets to that instead of File's Owner.
Brent Royal-Gordon