Navigation Controller + Tab Bar Controller needed

Discussion in 'iOS Programming' started by siva.d, Oct 29, 2008.

  1. macrumors newbie

    Joined:
    Sep 30, 2008
    Location:
    Hyderabad,India
    #1
    I started doing iphone application development from one week.

    I have probelm :

    1) I need a welcome view controller initially without any "Navigation controller" and "TabBar Controller".
    I have a button in this viewController. so when i click on that button it should goto login view.

    2)In login view also i don't need "Navigation controller" and "TabBar Controller".
    Here when i click login button, it should goto main view.

    3)In main we i need navaigationa controller as well as Tabbar Controller.

    If you have any sample code please send me.

    welcomeViewControler --> loginViewControler --->mainViewController.

    I want to learn how it works with IB.

    Thanks in advance
     
  2. macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
    #2
  3. thread starter macrumors newbie

    Joined:
    Sep 30, 2008
    Location:
    Hyderabad,India
    #3
    want NavigationController+ TabBarController in a viewController.(not in AppDelegate)

    Thanks for your replay

    i seen examples which can give NavController and TabController Form appDelegate using IB.

    But i need Those Controllers(NavBar and TabBar) in a ViewController. In the same viewController, i want TableView also.
     
  4. thread starter macrumors newbie

    Joined:
    Sep 30, 2008
    Location:
    Hyderabad,India
    #4
    TabBarController

    Hi,

    i have created a TabBarControler Using IB.

    I have assigned two nib files for two tabs of that TabBarController.

    I am calling that TabBarController nib file like this(in a button click action)

    -(IBAction) level3View:(id)sender{
    UITabBarController *tabBar1=[[UITabBarController alloc] initWithNibName:mad:"tabBar1" bundle:nil];
    WorkspaceViewController *workspaces=[[WorkspaceViewController alloc] initWithNibName:mad:"Workspace" bundle:nil];
    ContactsViewController *contacts=[[ContactsViewController alloc] initWithNibName:mad:"Contacts" bundle:nil];
    tabBar1.viewControllers=[NSArray arrayWithObjects:workspaces,contacts, nil];
    [self setMyTabBar:tabBar1];
    [[self navigationController] pushViewController:myTabBar animated:YES];
    }

    It is working without any error.

    Tabbar is visible, But Tabs are not visible on new view(displaying empty tab bar):confused:

    How to get those tabs visible.

    please....
     
  5. thread starter macrumors newbie

    Joined:
    Sep 30, 2008
    Location:
    Hyderabad,India
    #5
    Hi,

    -(IBAction) level3Viewid)sender{
    UITabBarController *tabBar1=[[UITabBarController alloc] init];
    WorkspaceViewController *workspaces=[[WorkspaceViewController alloc] initWithNibName:mad:"Workspace" bundle:nil];
    ContactsViewController *contacts=[[ContactsViewController alloc] initWithNibName:mad:"Contacts" bundle:nil];
    tabBar1.viewControllers=[NSArray arrayWithObjects:workspaces,contacts, nil];
    [self setMyTabBar:tabBar1];
    [[self navigationController] pushViewController:myTabBar animated:YES];
    }

    My tab bar is displaying its tabs now.

    its working fine.:D

    but problem is my navigation controller is not working.:confused:
     
  6. macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
    #6
    Rather than creating the layout programmatically, it's probably simpler to use Interface Builder to add a Navigation Controller and Tab Bar Controller to the same view.
     
  7. thread starter macrumors newbie

    Joined:
    Sep 30, 2008
    Location:
    Hyderabad,India
    #7
    Thank you jnic,

    Ya i am trying to that using Interface builder only.

    Do u have any sample application like that.

    Can u send that to me

    Thank you once again
     
  8. thread starter macrumors newbie

    Joined:
    Sep 30, 2008
    Location:
    Hyderabad,India
    #8
    NavgationController+TabBarController+TableView

    I did this using Interface builder.

    its working fine.

    i want to share the code.

    But i dont know how to attach the zip file here.

    can any one help me?

    thanks
     
  9. macrumors newbie

    Joined:
    Jul 16, 2009
    #9
    NavgationController+TabBarController+TableView

    Hi Siva.d

    I am new to iphone and I am facing the same issue.. From your post it is pretty clear that you have achieved your requirement long back.
    I would be very thankful if you please share as to how did you achieve the solution?
     
  10. macrumors regular

    Joined:
    Apr 18, 2009
    #10
    I dont understand whats your main navigation control. The NavBar? or Tab Bar?
    If its the tabBar? then you should add the tabbarcontroller first to your Mainview.xib. then add NavigationController to a tabbar.

    You look like a beginner, I'm a little ahead of that, My advice is, to use IB effectively and where you can. In most circumstances, it does its Job. IB is there for a reason. To make our lives easier. Its hard to understand at first. But play around with it alot more and watch videos and tutorials.

    You should choose ONE control as your apps backbone so to speak. Like a TabBarController can be your app's backbone. There can be views here and there.. without it.
     
  11. macrumors newbie

    Joined:
    Jul 16, 2009
    #11
    hello

    my requirement is - my application's first screen is a login screen which doesnot require any tabbar. once logged in I have a Home screen which is basically a table view in a navigation controller. I need the tabbar from this screen onwards. How do I achieve it..If I take Tab Controller as the backbone I will be required to
    1.first hide the tab bar in the first screen
    2.second remove the first tab(basically resembling the first screen) from the tab bar in rest of the screens.

    Please someone help me to as to how can I achieve this?

    Thanks in advance
     
  12. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #12
    Make the Tab Bar Controller your main view. (This is always good advice). Then make your login screen a modal view.
     
  13. macrumors newbie

    Joined:
    Jul 16, 2009
    #13
    Hi dijo,

    Thank you so much for responding.. As per your suggestion I looked into the concept of model view. But I am unable to find some relevant example to implement the same. can you please help me on this?
     
  14. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
  15. macrumors newbie

    Joined:
    Apr 16, 2009
    #15
    Hi All,
    I am new to the iPhone development, gone through various docs and tutorials and worked on simple first app.

    Now I need to develop a app for real.
    Reading through this thread I am in need of a good example for
    welcomeViewControler --> loginViewControler --->mainViewController

    similar to siva.d original posts.

    I have created a login view, and can create a separate table view.
    Problem I am having is making them flow
    Open Login View,
    Display Main tab view controller.

    Anyone have points to good sample good/tutorials showing this multiple views and transitions from one to another.

    Thanks in Advance
     
  16. macrumors newbie

    Joined:
    Nov 27, 2009
    #16
  17. macrumors newbie

    Joined:
    Apr 9, 2010
    #17
    hihi Siva
    Please can you forward your sample code to me for reference? I am looking for the solution as well, it will be hiiiiiiiiiiiiiiiighly appreciated to get an effort from you !!
     
  18. macrumors member

    Joined:
    Aug 5, 2010
    #18
    Hi Shiv i am new to iphone n facing the same problem found ur quote on google pls will u exp with exmple hw to solve the abv problem..
    Can't we use tabbar and navigationbar in view instead of tabbar controller and navigation controller in window
     

Share This Page