触摸按钮时更改视图

时间:2022-07-06 23:11:24

I have two view controllers: firstViewController and secondViewController. On the firstViewController I have a button. How can I change the view when I touch the button?

我有两个视图控制器:firstViewController和secondViewController。在firstViewController上我有一个按钮。触摸按钮时如何更改视图?

1 个解决方案

#1


7  

- (IBAction)change {

    secondViewController* viewController = [[secondViewController alloc] init];
    [self.navigationController pushViewController:viewController animated:YES];
    [viewController release];

}

#1


7  

- (IBAction)change {

    secondViewController* viewController = [[secondViewController alloc] init];
    [self.navigationController pushViewController:viewController animated:YES];
    [viewController release];

}