我有以下代码:
- (IBAction)buttonPressed:(UIButton *)sender
{
//sentder.titleLabel
NSString *label = [(UIButton *)sender currentTitle];
if ([label isEqualToString:@"Register"])
{
[sender setTitle:@"Registers" forState:UIControlStateNormal];
RegisterViewController *viewCon = [[RegisterViewController alloc] init];
RegisterNavigationController *navigation = [[RegisterNavigationController alloc] init];
[navigation pushViewController:viewCon animated:YES];
//self performSegueWithIdentifier:@"MySequeIdentifier" sender:];
}
....
我有一个带有以下按钮代码的 startController 可以正确调用。我创建了一个全新的默认 registerViewController (UIViewController) 和一个 registerNavigationContoller (UINavigationController 类)。如何让我的按钮单击以动画到 registerViewController 并让该视图控制器有一个带有后退按钮的栏?
我做错了吗,startViewController 是否应该是 UINavigationController,因为它只是 UIViewController?如果是这样,我如何摆脱此页面上的顶部栏?