title: Display login screen before Tab bar controller
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8504219/show-a-login-screen-before-tab-bar-controller">show a login screen before Tab bar controller?</a>  </p>
  </blockquote>
  
  
  
  <p>i am designing an iphone application which should be display login screen initially, after that it should display tab bar controller with 5 tabs. Am able to launch login screen initially, but when the login button is clicked am unble to show tab bar controller, kindly help me out with the code. here is my code: this is a view based application. Here is my code:</p>
  
  <p>delegate.h</p>
  
  <pre><code>@interface iphoneAppDelegate : NSObject &lt;UIApplicationDelegate&gt; {
      UIWindow *window;
  
       IphineViewController *viewController;
      IBOutlet UITabBarController *aTabBarController;
  }
  
  @property (nonatomic, retain) IBOutlet UIWindow *window;
  
  @property (nonatomic, retain) IBOutlet IphoneViewController *viewController;
  
  @property (nonatomic, retain) IBOutlet UITabBarController *aTabBarController;
  
  @end
  </code></pre>
  
  <p>delegate.M</p>
  
  <pre><code>-(void)applicationDidFinishLaunching:(UIApplication *)application {  
  
  // Override point for customization after app launch 
  
     [window addSubview:viewController.view]; 
  
     [window makeKeyAndVisible];
  
     LoginView *loginView=[[LoginView alloc]initWithNibName:@"LoginView" bundle:nil];
  
     [window addSubview:loginView.view];
  
  }
  </code></pre>
  
  <p>loginView.M</p>
  
  <pre><code>TabBarController *tabBarController = [[TabBarController alloc]initWithNibName:@"TabBarController" bundle:nil];
  
      [self.view addSubView: tabBarController.view];
  
  
      [tabBarController release];
  </code></pre>
  
  <p>my question is:</p>
  
  <p>1)can i use tab bar controller in the login view. I have declared ta bar in the delegate.h
  If this not correct how to use tab bar controller in my loginview.m</p>