触摸按钮时更改视图

时间:2011-10-31 08:15:27

标签: objective-c cocoa-touch

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

1 个答案:

答案 0 :(得分:7)

- (IBAction)change {

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

}