开发者

iPhone SDK: how to switch from a login screen to a navigation interface?

I am beginning in iPhone development and have followed a few tutorials开发者_如何学C, 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.


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]];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜