开发者

How do you load data into a Table View when there's both a Tab Bar and a Nav Bar?

开发者 https://www.devze.com 2022-12-29 02:56 出处:网络
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,

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?

How do you load data into a Table View when there's both a Tab Bar and a Nav Bar?

How do you load data into a Table View when there's both a Tab Bar and a Nav Bar?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消