Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

belsokar

macrumors member
Original poster
Jul 21, 2005
80
43
I have successfully created an application based on a UINavigationController that drills down a few levels from TableView to another TableView to a standard UIView.

I now want to create a UITabBarController application, and have one of those tabbed views point to my existing UINavigationController that I have already setup...I am having an incredibly difficult time doing so however. I tried setting my existing UINavigationController to be reference from the actual view within the Tab Bar...but that didn't work.

I then tried within interface builder...if you select the UITabBarController item attributes, you can change the various views to one of the following (View Controller, Navigation Controller, Table View Controller, or Image Picker Controller). I selected Navigation Controller, but then I can't figure out how to link that Navigation Controller object back to my existing classes.

Any ideas or pointers would be great!
 

alankernel

macrumors newbie
Jan 3, 2009
2
0
UITabBarController and UINavigationController together???

Did you get your problem resolved? I'm facing the same issue.

I would appreciate it if you can share sample code that has a Tab Bar at the top and at least one of its tab items is associated with a navigation controller and others maybe with regular view controllers or navigation controllers. Then, each of the navigation controllers drills down into other views through tables.

I'm new to iPhone development and this IB connection activity is really confusing me. I can't seem to find a good document that summarizes it and puts things in context.

Thanks

al
 

stadidas

macrumors regular
Feb 27, 2006
243
0
Kent, United Kingdom
I then tried within interface builder...if you select the UITabBarController item attributes, you can change the various views to one of the following (View Controller, Navigation Controller, Table View Controller, or Image Picker Controller). I selected Navigation Controller, but then I can't figure out how to link that Navigation Controller object back to my existing classes.

You are almost there. Where you have changed the view type in the tab view to NavigationController, you need to select this navigation controller and set it from an instance of UINavigationController to your navigation view controller subclass.
 

alankernel

macrumors newbie
Jan 3, 2009
2
0
Tab Bar with Navigation and Table Views.

Stadidas,

Can you please clarify?
In my case, I created a navFooCtrlr.h/m as follows:

navFooCtrlr.h:

#import <UIKit/UIKit.h>
@class navDetailCtrlr;


@interface navFooCtrlr : UINavigationController <UITableViewDelegate, UITableViewDataSource> {

NSArray *list;
FooDetailCtrlr *childController; //this is supposed to be a detail view which will be called when I click on one of the rows in the table

}

@property (nonatomic, retain) NSArray *list;

@end


navFooCtrlr.m:

#import "navFooCtrlr.h"
#import "FooDetailCtrlr.h"
#import "NavFooDelegate.h"

@implementation navFooCtrlr
@synthesize list;

//etc etc..


- I created a new IB navFoo.xib and I set its class to navFooCtrlr in its Class Identity tab. The navFoo.xib contains a table view that is populated with a list of names.

The problem is that it seems to be launching the view but I don't see the table entries. If I link the table view in a xib file directly under the tab bar item, it displays the table data.

This may be a very easy issue but considering that I'm fairly new to iPhone programming, I'm probably missing something trivial.

Thanks.

al.
 

stadidas

macrumors regular
Feb 27, 2006
243
0
Kent, United Kingdom
Stadidas,

Can you please clarify?

I have a similar concept to you in one of my projects. My MainWindow.xib contains a TabBarController. Most of the tabs then contain a navigation controller, and the default view of the navigation controllers is a view that contains a table view. Look at the attached image - in my case SummaryViewController is the controller of the SummaryView.xib containing the table view. In your case, substitute SummaryViewController for navFooCtrlr.
 

Attachments

  • ViewControllers.png
    ViewControllers.png
    79.9 KB · Views: 479
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.