Navigation Controll in TabBar Controller

Discussion in 'iOS Programming' started by CorporateFelon, Jun 22, 2009.

  1. CorporateFelon macrumors regular

    CorporateFelon

    Joined:
    Oct 26, 2007
    Location:
    Boston, MA
    #1
    Ok i'm just about pulling my hair out over this. I should preface that I'm new to iphone programming.

    What I'm trying to accomplish. Have a TabBarController loaded with a few items that are Navigation Controllers, then load custom views into each navigation controller.

    What is frustrating me is that I got it to work, but I can not do it again.

    I'm sort of following this video (http://vimeo.com/5226994) that shows how to add a tab bar item to a tab bar application. However in the video he is adding a View Controller, and I am trying to add a Navigation Controller.

    Like I said I was able to make it work for one item, but I cant reproduce it. (I probably shouldnt have taken a lunch break after getting it to work).

    At the moment in Interface Builder, when I try to add a Navigation Controller to the Tab Bar I see the Navigation Controller show up with the View in the middle, but now I can seem to load a custom view into that item. The item that I did get to work shows "View Loaded from 'CustomViewController'", while new items just show "View".

    The app runs fine, but I do get a warning "Selected Navigation Controller (Item1) has its 'NIB Name' property set to 'CustomViewController.nib' but this view controller is not intended to have its view set in this manner."

    To recap, following that video as an example I can get ViewControllers to work, but I am trying to use NavigationControllers instead in the TabBar.

    If any one can point me in the right direction that would be fantastic.
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Try not to forget that UINavigationController is just a subclass of UIViewController.
     
  3. CorporateFelon thread starter macrumors regular

    CorporateFelon

    Joined:
    Oct 26, 2007
    Location:
    Boston, MA
    #3
    I figured out what I was doing wrong.

    In interface builder I was viewing the inspector of the TabBarItem instead of the the NavigationController that I added. So I was trying to set the NIB Name of the wrong object.
     

Share This Page