简体   繁体   中英

How to set up a Tab Bar iOS app with UITableViews?

I am attempting to create a 3 tab iPhone Application with UITableViews on 2 of the tabs. I think I remember reading somewhere in Apple's documentation that it's not kosher to put navigation controllers like the one supplied in the navigation template on a tab bar App. However, this is precisely what I am attempting to do and I wanted to know how I would go about doing it?

I started with the tab bar template and simply added this to the firstView header:

@interface FirstViewController : UIViewController {
    IBOutlet UITableView *tableView;
}
@property(nonatomic,retain) IBOutlet UITableView *tableView;

@end

I added a UITableView through IB and set the delegate and datasource to the FirstViewController's File Owner, but for some reason, I am not seeing tableView when I try to set it as the outlet from File Owner. It makes me think that I am possibly going about this the wrong way. Any advice at all would be greatly appreciated.

I am fairly new to programming overall, so please try to be clear.

One way to approach it, from the nib, results in a structure looks like this:

Tab Bar Controller

-Tab Bar

--Navigation Controller

---Navigation Bar

---View Controller 1

---Tab Bar Item

--Navigation Controller

---Navigation Bar

---View Controller 2

---Tab Bar Item

...etc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM