Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6168693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:43:54+00:00 2026-05-23T22:43:54+00:00

I have an app that is based on a tab bar view with a

  • 0

I have an app that is based on a tab bar view with a welcome screen (that leads to either signin or sign up process). basically, if you are logged in – you go straight to the tabbar view and if not, you go to the welcome screen, where you can chose to either go to sign in or sign up. assuming that you go to either sign in or sign up, i would like the tab bar view to reappear, however, all the declarations are in the AppDelegate. how can I “go back” and call the tabbatcontroller? is the structure / flow of my classes correct at all?

so to repeat:

  1. user signed in -> first view is tab bar view
  2. user logged out -> welcome screen view –> sign in / up screen view –> tab bar view

what i am looking for is what do i need to write in this action method that is called once the user clicks on “sign in” in the sign in page:

-(IBAction)done:(id)sender {

?????

}

for reference, my appDelegate is:

  if(user signed in)
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *viewController1 = [[FirstTab alloc] initWithNibName:@"FirstTab" bundle:NSBundle.mainBundle];
UIViewController *viewController2 = [[SecondTab alloc] initWithNibName:@"SecondTab" bundle:NSBundle.mainBundle];
UINavigationController *secondNavController = [[UINavigationController alloc]initWithRootViewController:viewController2];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, secondNavController, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];

}
else
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    SigninTabBarTemplateViewController *landingPage = [[SigninTabBarTemplateViewController alloc] initWithNibName:@"SigninTabBarTemplateViewController" bundle:nil];
    self.window.rootViewController = (UIViewController *) landingPage;            
    [self.window makeKeyAndVisible];   
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:43:54+00:00Added an answer on May 23, 2026 at 10:43 pm

    There are many options you can consider.

    This can be easily achieved with the use of delegate. If you want to close the VC that you presented modally, give it a delegate property. The delegate will be sent a message when required, letting it dismiss the VC. A good way to go with delegate is to write a custom procotol.

    For example :

    // the delegate will conform to this protocol
    @protocol SignInVCDelegate
    
    // this method will be called when required
    //
    -(void)signInCompleted;
    
    @end
    

    Now, make the object you want conforms to that protocol, for example the app delegate.

    // .h
    #import "SignInVCDelegate.h"
    
    @interface YourAppDelegate : NSObject <..., SignInDelegate> {
        ...
        SignInVC *signIn;
        ...
    }
    
    -(void)signInCompleted;
    
    @end
    

    The implementation looks like this :

    // .m
    ...
    -(void)signInCompleted {
        ...
        [signIn.view removeFromSuperview];
    }
    
    -(BOOL)applicationDidFinishLaunching {
        if(!logged) {
            ...
            [signIn setDelegate:self];
            [self.tabBarController presentModalViewController:signIn
                                                     animated:YES];
        }
    }
    

    Now give signInVC a delegate property, which will be set before being presented modally, and send the delegate a message when the sign in process is completed.

    // in .h
    @property(retain) id <SignInDelegate>delegate;
    
    // in .m
    @synthesize delegate;
    
    -(IBAction)validateSignIn {
        ...
        [delegate signInCompleted];
    }
    

    You can write any method you want, this example is simplist, and it is useful to give the delegate some informations. In this case for example you could pass a user name, or user id, or what ever you want.

    Another simple option is using notifications. This option lets any object informed when something happen, as long as it register for it. Given the same objects as the previous example, the app delegate will register for the notification, while the sign in view controller will post it.

    // in app delegate .m
    -(BOOL)applicationDidFinishLaunching {
        ...
        [[NSNotificationCenter defaultCenter]
         addObserver:self
            selector:@selector(signInCompleted)
                name:@"UserSignedInNotification"
              object:nil];
    }
    
    // in SignInVC.m
    -(IBAction)validateSignIn {
        ...
        [[NSNotificationCenter defaultCenter]
         postNotificationName:@"UserSignedInNotification"
                       object:self];
    }
    

    More informations about delegates and notifications in Communicating with Objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating app based on UTabbarController. I have creates that tab bar programmatically.
I have a view based app (not navigation or tab based...) My main view
I have an app based on a tab bar and data retrieved from the
i'm making app based on tab bar with two tabs. My problem is that
I am having an issue: I have a tab-bar based app. In MainWindow.xib for
I have a app based off the default xcode Tab Bar Application template. It
I have an iPhone app that is based on a navigation controller. I have
I have a simple iphone app that's based on the CrashLanding sample app. So
I have an iphone app that I built based off a tutorial (for a
I have an app that creates a variable number of ScatterviewItems based on which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.