Tab Bar Controller

Discussion in 'iOS Programming' started by TripleJ, Aug 2, 2008.

  1. macrumors regular

    Joined:
    Jul 30, 2008
    #1
    This is probably really simple, but I've struggled with it for two days so if anyone could help me out with this I'd be immensely grateful!

    I'm using the NavBar template from apples samplecode and i want to link one of the options to a view with a tab bar. I can get the tab bar working seperately but the second I link it to the navbar, it displays but stops doing anything. if anyone could point me in the right direction or help me fix this I'll do their dishes for the rest of the year! :D

    Thank you so much!
     
  2. macrumors 65816

    dgdosen

    Joined:
    Dec 13, 2003
    Location:
    Seattle
    #2
    As far as I know - you can't!

    You can have a navigation controller on each tab, but not vice versa. Apple mentioned this at the WWDC. Why would a tab view go away? You could do it if you show something modally over the whole window.
     
  3. macrumors 65816

    Joined:
    Jan 6, 2004
    #3
    Its do-able! I am currently doing it by adding the following code to the controller of your TabBar:

    Code:
    - (void)viewDidLoad {
    	[super viewDidLoad];
    	self.view = tabController.view;
    
    	tabController.selectedIndex = JSON_TAB;
    	
    }
    
     
  4. macrumors 65816

    dgdosen

    Joined:
    Dec 13, 2003
    Location:
    Seattle
    #4
    I think it would go against Apple's UI Guidelines, but if it feels right then go ahead.
     
  5. thread starter macrumors regular

    Joined:
    Jul 30, 2008
    #5
    Worked perfectly! You are officially my hero!
    I don't understand though, is this against the agreement or is it just that apple thinks it's weird design?
     

Share This Page