Using a UITabbarController inside a SplitviewController


#1

I have a view controller that is placed inside of a navigation controller. This is then placed inside of a tabbar controller which is then placed inside of a split view controller. I have this mainly to maintain a consistent look. Anyway, when I try to set the title of the tab nothing shows up. If I remove the navigation controller it works. How do I get this to work with the navigation controller?

The setup for the view controller > nav controller > tabbar controller > split view is all done in the app delegate.


#2

OK. Here’s what I did. Since this particular view needed to be designed in a xib anyway, I simply dragged out a navigation bar and set the properties programatically. While this works, is this standard procedure?


#3

Well, I went back to the programmatically settings but still cannot get the tab bar item to display. Any idea?


#4

So this isn’t going so well. I am trying to implement an interface that utilizes a split view as well as a tabbar. The detail view will have the tabbar. When one if the tabs is selected I want an entirely new set of views loaded - master and detail. For instance, one of the tabs could be for entering results of a test (the master would hold a list of various tests) and another tab would allow one to set maybe options for the app. I cannot figure out how to load an entirely new scene i.e. left and right views. I think my main source of error is occurring because I’m using a tabbar with the detail view.

Help.


#5

Bueller … Bueller … Bueller?

Anyone? When one of the tabBar items is selected the new detail view loads, but not the master/tableview? It retains the old table? Here’s the code for the new “scene”. It is located in the new viewController.

//Setting up an interface when blue is selected - i.e. viewWillAppear
//Master View and put into nav controlller
    ThirdTableViewViewController *thridTable = [[ThirdTableViewViewController alloc] initWithStyle:UITableViewStyleGrouped];
    UINavigationController *mstrNav = [[UINavigationController alloc] init];
    [mstrNav setViewControllers:[NSArray arrayWithObjects:thridTable, nil]];
    
//Detail View
    TBTBluePage *bluePage = [[TBTBluePage alloc] init];
    Record *record = [[Record alloc] init];
    UITabBarController *tbc = [[UITabBarController alloc] init];
    [tbc setViewControllers:[NSArray arrayWithObjects:record, bluePage, nil]];
    [[self splitViewController] setDelegate:self];
    
//Put both into splitviewcontroller
    UISplitViewController *svc = [[UISplitViewController alloc] init];
    [svc setViewControllers:[NSArray arrayWithObjects: mstrNav, tbc, nil]];
    
    [self.view.window setRootViewController:svc];

#6

I know I’m talking to myself here, but I’m also hoping someone will pipe in.

I’m beginning to think I will need to do one of the following to get something like this to work properly.

[ul]

  1. Subclass UISplitviewController and/or UITabbarController
    OR
  2. Subclass a UIView and create my own custom view including a table etc.
    [/ul]

#7

YES. Subclassing appears the way to go. Made more progress tonight using a splitview subclass than the last 7days combined.

If it weren’t for this book I’m not sure I would have felt comfortable to even attempt to subclass.