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 4595398
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:57:53+00:00 2026-05-21T22:57:53+00:00

I actually work on an iPad application, which contains a secured member area. The

  • 0

I actually work on an iPad application, which contains a secured member area.
The application itself uses a TabBarNavigation with a UIViewController for each tab.

To show up the LoginForm on the “Member-Area”-Tab, when User is not logged in, I created the LoginScreen in a separate UIViewController and tried to present it as ModalView on the ViewWillAppear-Method.

Unlikely it seems that ViewWillAppear / ViewDidLoad can’t handle the modal view.
Every Tutorial or Sample I found uses a Button-Action to show up the ModalView.

Isn’t it possible to show it without pressing something?

The Code I used in “MemberViewController” ViewWillAppear looks like that:

        -(void)viewWillAppear:(BOOL)animated{
    LoginViewController *loginInstance = [[[LoginViewController alloc] init] autorelease];

    [self presentModalViewController:loginInstance animated:YES];    
    [loginInstance release];
}

Would be great if someone could help!

  • 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-21T22:57:54+00:00Added an answer on May 21, 2026 at 10:57 pm

    Create an empty UIViewController, with something like this:

    #import "LoginViewController.h"
    #import "MemberViewController.h"
    
    - (void)viewDidLoad {
    [super viewDidLoad];
    
    [self performSelector:@selector(checkForLogin)];
    }
    
    - (void)checkForLogin {
    NSString * checkString = [[NSUserDefaults standardUserDefaults] objectForKey:@"LoginCheck"];
    
    if ([checkString isEqualToString:@"YES"]) {
    
    MemberViewController * memberInstance = [[MemberViewController alloc] init];
    [self presentModalViewController:memberInstance animated:YES];
    [memberInstance release];
    
    } else {
    
    LoginViewController * loginInstance = [[LoginViewController alloc] init];
    [self presentModalViewController:loginInstance animated:YES];
    [loginInstance release];
    
    }
    
    }
    

    In the LoginViewController.h add this to the function that’s being called when the login is valid:

    [[NSUserDefaults standardUserDefaults] setObject:@"YES" forKey:@"LoginCheck"];
    [[NSUserDefaults standardUserDefaults] synchronize];
    

    I think this should do the trick 😉

    There can be some errors, I typed this from my head right here on the website

    Edit: attach the new empty view controller to the UITabBarController item where the login is needed 😉

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

Sidebar

Related Questions

PLEASE NOTE, I have found a work around which actually works out better for
My application icon's work fine when displaying on iPad and iPhone, however after I
Has anybody got this to actually work? Documentation is non existent on how to
Does anyone know how DbDataReaders actually work. We can use SqlDataReader as an example.
so it would appear that the only values that actually work are 0.0, 0.5,
Is there any way I could run the following 'logical code' to actually work?
Like many variables in PHP using ini_set() on a page doesn't actually work. I've
How does read(buffer, offset, length) actually work, if i pass the length to read
Actually We are doing thesis work where we need to make 10 voip phones
Problem This question actually came up at work today. We are planning an experiment

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.