iPhone SDK:如何从登录界面切换到导航界面? [英] iPhone SDK: how to switch from a login screen to a navigation interface?

查看:74
本文介绍了iPhone SDK:如何从登录界面切换到导航界面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始从事iPhone开发,并且已经学过一些教程,但请指出我是否走错了方向。我已经实现了自己的UInViewController和一个登录屏幕视图(带有xib)。

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).

我想要做的是点击登录按钮后,它会显示RootViewController.xib,其中包含Xcode的默认导航应用程序模板。

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.

这可能吗?怎么样?

非常感谢你的帮助。

推荐答案

发送一个登录时通知您的AppDelegate并从keyWindow中删除视图并将navigationController添加到同一个keyWindow。

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

这篇关于iPhone SDK:如何从登录界面切换到导航界面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆