简体   繁体   中英

Login screen before tabController at IOS (Xcode 4.2)

First of all i'm very new at IOS development. Trying to put a loginView before a tabController . Found various ways on other questions like; Show a login screen before a Tab Bar Controller

    LoginScreenViewController *login = [[LoginScreenViewController alloc] initWithNibName:@"LoginScreenViewController" bundle:nil];
    [self.window addSubview:login.view];
    [self.window makeKeyAndVisible];

at first i couldn't use initWithNibName function cuz there is no files for Views; all views was in storyboard. Then i figure out how to create files for new views. At tried above code again. It builded but nothing happens; tabcontroller show up not login view.. I'm not sure what am i doing wrong. The main idea i got from other questions' answers is init with tabController and show login view as a modal window. Why are doing that ? Can we init with loginView then if login succeed show the tabBarController? Is it not possible ?

This is my first time on IOS (Objective C) and its not making any sense at all to me. If I load tabController first how can i load user's info who not loged in yet ? I spend 2 full days on this. Anyone have an idea ? (do not forget i'm new on this. Dont be harsh on me :P)

Thanks and take care!

Have your login controller as the root controller and then present you tabbed controller as modal controller of the login controller.

You'll need to call presentModalViewController: on the login controller to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM