如何在另一个视图中按下按钮来调用视图?
答案 0 :(得分:2)
按下按钮的位置:
[myButton addTarget:self action:@selector(clickedButton:) forControlEvents:UIControlEventTouchUpInside];
然后在一个单独的函数中:
-(void)clickedButton:(id)selector {
// delete as appropriate
[self.navigationController pushViewController:viewController animated:YES];
// or
[self.view addSubview:theView];
// or
[self presentModalViewController:viewController animated:YES];
}