更新时间:2023-01-04 21:22:29
按照下面的步骤,让按钮选择器是
Follow the below step,let the button selector is
[button addTarget:select action:@selector(buttonClick) forControlEvents:UIControlEventTouchUpInside];
并将选择器实现为
-(void)buttonClick{
UIViewController *controler = [[UIViewController alloc] init];
[self.navigationController pushViewController:controler animated:YES];}
并确保 viewController 中嵌入了 NavigationController,并将 UIViewController 替换为您希望推送的控制器.
and also make sure viewController has NavigationController embedded within it and replace UIViewController with the Controller you wish to push.