用Pop方式切换ViewController

第一个ViewController中的按钮方法:

  SecondViewController *secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
    //设置第二个窗口中的delegate为第一个窗口的self
    secondView.delegate = self;
   
    [self.navigationController pushViewController:secondView animated:YES];

第二个ViewController中的按钮方法:
  [self.navigationController popViewControllerAnimated:YES];


评论

此博客中的热门博文

viewWillAppear不执行的解决办法

iOS中使用xpc/xpc.h

图片旋转时的边缘抗锯齿的三种方法以及性能