Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

loon3y

macrumors 65816
Original poster
Oct 21, 2011
1,235
126
i made a login screen for my tab bar app, i want to make it so the login screen appears when u first login and than disappears after u log in, but i don't want it to be in the tab bar.
 
I've done something similar in an earlier version of applicationDidFinishLaunching: in my app delegate. I have not tried this with the newer version of application:didFinishLaunchingWithOptions: but expect it to work. When you return from the login screen, it will return to the view controller you have already setup where I comment "The usual setup".

Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
	// The usual setup.
	[self.window makeKeyAndVisible];

	[self login: self];
}

- (void) login: (id) sender
{   
	LoginVC * loginVC = [[LoginVC alloc] initWithNibName:@"LoginVC" bundle: nil];
	// Do any extra setup of loginVC here.
    
	[self.navigationController setNavigationBarHidden: YES animated: YES];
	[self.navigationController pushViewController: loginVC animated:YES];
	//[self presentModalViewController: loginVC animated: YES];

	[loginVC release];
}
 
Hmm, I took nearly the same approach as above post.
But we had a user saved, so checked first if there was one saved, if there isn't, show the tabbar (by adding it to the window), and otherwise showing the login view as a controller, and if your login options are met, then show the tabbar controller (could be done via NSNotification or whatever).
 
What I've done to add a startup login to an otherwise working UI, is simply to present the login view controller modally and then dismiss it once they've logged in.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.