> 
> **Possible Duplicate:**  
> 
> [show a login screen before Tab bar controller?](https://stackoverflow.com/questions/8504219/show-a-login-screen-before-tab-bar-controller) 
> 
> 
> 

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:

delegate.h

```
@interface iphoneAppDelegate : NSObject <UIApplicationDelegate> {
    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

```

delegate.M

```
-(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];

}

```

loginView.M

```
TabBarController *tabBarController = [[TabBarController alloc]initWithNibName:@"TabBarController" bundle:nil];

    [self.view addSubView: tabBarController.view];

    [tabBarController release];

```

my question is:

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