0

如何在选项卡式应用程序中构建登录视图?我是ios开发新手。我通过互联网阅读了很多内容,但没有人只是发布我能理解的代码。任何帮助表示赞赏=)。

4

2 回答 2

0

这是一个相关的帖子:在 IOS 的 Cocoa Touch Tab Bar Application 前面添加登录屏幕

我更喜欢这样写。

[window setRootController:tabBarCon];
if (notLogedIn) {
    loginViewController = [[InitialScreenViewController alloc] init];
    [tabBarCon.view addSubview:loginViewController.view];
}
[window makeKeyAndVisible];
return YES;

- (bool)notLoggedIn {
     //check if there is any sessions exists in local storage
}

如果您的内容与用户帐户相关,请记住实现登录后重新加载内容的方法。

于 2012-06-21T07:46:34.937 回答
0

最后我这样做是为了解决我的问题:

我的 rootViewController 是我的注册视图,然后我设置了一个实现自定义 segue 的按钮:

-(IBAction)button {
    NSLog(@"username: %@, password: %@, passwordrt: %@", username.text, password.text, passwordrt.text);
    [self performSegueWithIdentifier:@"tabBar" sender:self];
}
于 2012-06-21T11:18:01.683 回答