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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:27:44+00:00 2026-06-01T13:27:44+00:00

I am working on an app which requires that the user be logged in

  • 0

I am working on an app which requires that the user be logged in at all times. Initially it has a login view, and when the user is logged in this is replaced with a tabbar view. If I build to either my device (iOS 5.0) or to the 5.0 simulator it works fine. However if I build to the 4.3 simulator I get strange problems.

For instance: the first tab that it opens onto originally contained the login view – I haven’t got round to removing it yet so at the moment as soon as that tab opens it fades from a login view to a menu screen (both are separate views within the first tab). In iOS4.3 builds this first view does not fade out.

I recoded it to skip past the first screen and have the first tab open directly into the menu screen which has the users Facebook friends list. I have printed the friends list to the console and it is received correctly – yet the list appears empty in iOS4.3 and works fine in iOS 5.0.
These things all worked until I implemented the separate login view (afaik). I’m presuming that I have not implemented the change between views correctly but I’m not sure where it is wrong as I do not get any errors printed to the console, and I can still change between tabs etc.

This is how I have done it so far (I’ll only include relevant parts):

appDelegate.h
@interface AppDelegate : UIResponder <UITabBarControllerDelegate,LoginViewControllerDelegate, otherDelegates>

 FirstViewController *viewController1;
SecondViewController *viewController2;
ThirdViewController *viewController3;
FourthViewController *viewController4;
FifthViewController *viewController5;
loginViewController *lvc;

@property (strong, nonatomic) UITabBarController *tabBarController;

…

appDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
lvc = [[loginViewController alloc] initWithNibName:@"loginViewController" bundle:nil];
lvc.delegate = self;
[self.window addSubview:lvc.view];
self.window.rootViewController = lvc;
[self.window makeKeyAndVisible];
}



- (void)loginViewControllerDidFinish:(loginViewController *)loginViewController {

//load windows and tab bar controller
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstViewController_iPhone" bundle:nil] autorelease];
viewController2 = [[[SecondViewController alloc] initWithNibName:@"SecondViewController_iPhone" bundle:nil] autorelease];
viewController3 = [[[ThirdViewController alloc] initWithNibName:@"ThirdViewiPhone" bundle:nil] autorelease];
viewController4 = [[[FourthViewController alloc] initWithNibName:@"FourthViewiPhone" bundle:nil] autorelease];
viewController5 = [[[FifthViewController alloc] initWithNibName:@"FifthViewiPhone" bundle:nil] autorelease];
[viewController4 updateTabBar];

self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, viewController3, viewController4, viewController5, nil];
self.window.rootViewController = self.tabBarController;
[self.window addSubview:self.tabBarController.view];
[self.window makeKeyAndVisible];
}


//called when logout button is pressed
- (void)removeTabBarView
{
//[self.tabBarController.view removeFromSuperview];
[self.window addSubview:lvc.view];
self.window.rootViewController = lvc;
 [self.window makeKeyAndVisible];
}

Edit: this is called in the appDelegate once all of the login data has been received.

[self loginViewControllerDidFinish:lvc];

The fact it works fine in iOS 5.0 is what’s really throwing me, I’m pretty new to app development so I have no idea how this could be done differently.
If anyone has any ideas I would be very appreciative.
Thanks

  • 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-06-01T13:27:45+00:00Added an answer on June 1, 2026 at 1:27 pm

    As usual I spent ages looking at it, gave up and decided to ask for help, and then realised a way to do it about half an hour later.

    I just put this after I setup the tabbar and set it as the view controller (i.e. put the login view on top):

    lvc = [[loginViewController alloc] initWithNibName:@"loginViewController" bundle:nil];
    lvc.delegate = self;
    [self.window addSubview:lvc.view];
    

    Then I just use:

    [lvc.view removeFromSuperview];
    

    to remove it once I’m logged in. Still don’t know why the other way didn’t work in iOS 4.3 though, so if anyone can provide an answer to that I’ll still mark a correct answer – in case anyone else has the same problem in future.

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

Sidebar

Related Questions

I am working on a web application which requires the user to login before
I'm working on an iOS app that requires the user to enter numbers into
I working for an app that requires google login. I need to access provider_uid,
I am working on a app which requires me to store some directions for
I am working with facebook app canvas which requires post. I am using express
I am working on an app which needs a very simple progress view .What
I have made an android app which working fine. I implemented the Login functionality
I am writing an app that requires the user's current location (lastknownlocation won't be
Background: I am working on an ASP.NET MVC app that has 3 partials (based
I am working on a web app project that has been in development for

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.