触摸按钮时更改视图

ast*_*x22 0 cocoa-touch objective-c

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

Sye*_*idi 7

- (IBAction)change {

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

}
Run Code Online (Sandbox Code Playgroud)