【发布时间】:2011-12-08 08:48:10
【问题描述】:
我在显示视图时遇到问题。在当前视图中按下按钮时,将执行以下操作:
- (IBAction) vistaUser: (id)sender{
loginTabController *theInstance = [[loginTabController alloc] init];
[theInstance logIn:user.text :password.text];
}
然后,调用logIn 函数之后必须显示userViewControler 视图但未显示。视图保持在当前一个。但是,userViewController 视图已初始化,并且此视图中的 getData 函数已执行!我不明白为什么不显示调用的视图!感谢您的帮助!
- (void)logIn: (NSString *)strUser: (NSString *)strPass
{
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
if (self.controladorUser == nil)
{
userViewController *aController = [[userViewController alloc] initWithNibName:@"userViewController" bundle:nil];
self.controladorUser = aController;
[aController release];
}
[UIView setAnimationTransition: UIViewAnimationOptionCurveEaseIn forView:self.view cache:YES];
[self.controladorPass viewWillDisappear:YES];
[self.controladorUser viewWillAppear:YES];
[self.controladorPass.view removeFromSuperview];
[self.view insertSubview:controladorUser.view atIndex:0];
[self.controladorPass viewDidDisappear:YES];
[self.controladorUser viewDidAppear:YES];
[UIView commitAnimations];
//getData call
userViewController *theInstance = [[userViewController alloc] init];
[theInstance getData:strUser :strPass];
}
【问题讨论】:
标签: objective-c ios xcode cocoa-touch uiview