在Cocoa Touch Tab Bar Application for IOS前面添加登录界面 [英] Adding login screen in front of Cocoa Touch Tab Bar Application for IOS

查看:78
本文介绍了在Cocoa Touch Tab Bar Application for IOS前面添加登录界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仍然在这里解决问题。我甚至不是很接近,但无论如何......我有一个从Xcode创建的TabBar应用程序。它有效我有三个标签视图,我知道如何操作,等等。

Still getting my head around things here. I'm not even close, but anyways.... I have a TabBar application created from Xcode. It works I have three tab views, that I know how to manipulate, etc.

我想在这整个事情面前放一个'登录'nib文件,要求用户回答(现在硬编码)用户名和密码。如果你做对了,那么,渲染标签部分,允许他们点击。

I'd like to put a 'login' nib file in front of this whole thing, requiring a user to answer a (hardcoded for now) username and password. If you get that right, then, render the tab portion, allowing them to click around.

我有另一个我写的用户名和密码部分的应用程序,我无法从那里获取逻辑,并把它放在TabApplication的前面。

I have another application that I've written that does the username and password part, I'm having trouble taking the logic from there, and putting it in front of the TabApplication piece.

任何人都有任何建议吗?

Anyone have any suggestions?

推荐答案

在你的AppDelegate中,在应用程序末尾的didFinishLaunchingWithOptions 方法你会看到:

In your AppDelegate, at the end of the application didFinishLaunchingWithOptions method you'll see this:

[window addSubview:tabcontroller.view];
[window makeKeyAndVisible];
return YES;

只需初始化您的登录视图控制器并在tabcontroller之后添加它,如下所示:

Simply initialize your login view controller and add it after the tabcontroller, like this:

initialScreenViewController = [[InitialScreenViewController alloc] init];
[window addSubview:tabcontroller.view];
[window addSubview:initialScreenViewController.view];
[window makeKeyAndVisible];
return YES;

在您登录viewcontroller时,在对用户进行身份验证后,您可以将其隐藏起来:

In you login viewcontroller, after authenticating the user you can hide it like this:

[self.parentViewController.view setHidden:YES];

如果你有注销功能,你可以再次显示它。

which allows you to show it again if you have a logout feature.

这篇关于在Cocoa Touch Tab Bar Application for IOS前面添加登录界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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