【发布时间】:2011-07-28 19:47:35
【问题描述】:
我正在实现一个 iPhone 应用程序,它是一个基于标签栏的应用程序。一开始,我抛出了一个模态视图,它显示了一个登录表单。如果登录正常,我将关闭此模式视图,并显示选项卡栏导航的第一个选项卡。问题是我需要将用户信息从模态视图传递到选项卡栏的控制器。 到目前为止,我得到的是: 在我的 AppDelegate 中:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
tabBarController.delegate = self;
// Add the tab bar controller's view to the window and display.
self.window.rootViewController = self.tabBarController;
[self addTabBarArrow];
[self.window makeKeyAndVisible];
//Throw up the Modal View
InicioAppModalViewController *tempView = [[InicioAppModalViewController alloc] initWithNibName:@"InicioAppModalView" bundle:nil];
[self.tabBarController presentModalViewController:tempView animated:true];
[tempView release];
return YES;}
在我的 InicioAppModalViewController 中,我有 2 个函数可以通过单击导航按钮项来显示带有登录表单的模式视图:
- (IBAction)showModalLoginForm:(id)sender {
LoginViewController * loginVC = [[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil];
[self presentModalViewController:loginVC animated:YES];
[loginVC release]; }
然后,在这个表单中,我刚刚获得了一些 TextField,我使用 NSURLConnection 方法验证登录是否正常。之后,在关闭此模式视图之前,我想将用户信息发送到导航栏控制器。
我该如何实现它?有什么建议吗?
提前致谢!!
【问题讨论】:
标签: objective-c xcode cocoa-touch cocoa