How to call a view upon pressing a button in another view?
How to cal开发者_如何学Cl a view upon pressing a button in another view?
Where you init your button:
[myButton addTarget:self action:@selector(clickedButton:) forControlEvents:UIControlEventTouchUpInside];
then in a seperate function:
-(void)clickedButton:(id)selector {
// delete as appropriate
[self.navigationController pushViewController:viewController animated:YES];
// or
[self.view addSubview:theView];
// or
[self presentModalViewController:viewController animated:YES];
}
精彩评论