I think I'm way overthinking the issue of having a Tab Bar project type and adding Nav Bar cont开发者_JS百科rols. I've followed some basic directions and have a demo app running fine with two tabs, each with a Table View and nav bars. But how do I load data into them? I know I need to hook up delegate
and dataSource
, but where?
You may want to consider storing the root controllers of each tab's UINavigationController
in separate NIB files too; you will set the file's owner in each controller as the controller and hook up your UITableView's datasource and delegate to the file's owner.
Apple's Interface Builder documentation has some good advice on keeping your NIB files small.
You datasource and delegate is typically the same object and the "View Controller" in your hierarchy. You can have them extend UITableViewController
and have much of the work done for you.
精彩评论