iPhone SDK: how to switch from a login screen to a

2019-02-03 20:28发布

I am beginning in iPhone development and have followed a few tutorials, but please indicate me if I'm going in the wrong direction. I have implemented my own UInViewController and a login screen view (with its xib).

What I would like to do is that after clicking on the login button, it displays the RootViewController.xib, which includes the Xcode's default navigation application template.

Is that possible? How?

Thanks alot for your help.

1条回答
迷人小祖宗
2楼-- · 2019-02-03 20:56

Send a notification to your AppDelegate when you do the login and remove the view from the keyWindow an add the navigationController to the same keyWindow.

- (void) applicationDidFinishLaunching: (UIApplication*) application {
    [_window addSubview: [_loginViewController view]];
    [_window makeKeyAndVisible];
}

// This method is on AppDelegate   
- (void) loginComplete {
    [[_loginViewController view] removeFromSuperview];
    [_window addSubview: [_navigationController view]];
}
查看更多
登录 后发表回答