Code Bye

父页面连续push3个view 。如何从ControlView3 返回父页面并刷新父页面?

 

[self.navigationController pushViewController:ControlView1 animated:YES];

[self.navigationController pushViewController:ControlView2  animated:YES];

[self.navigationController pushViewController:ControlView3  animated:YES];

父页面连续push3个view 。如何从ControlView3  返回父页面?  把ControlView1 ControlView2  ControlView3 都pop出去。然后调用父页面的一个方法,刷新父页面

20分
用到委托。你可以在ControlView3里定义一个委托。从ControlView3里退出的地方调用这个委托。

ControlView3的委托在父页面实现。实现的内容就是:

[self.navigationController popViewControlleranimated:YES];

[self.navigationController popViewControlleranimated:YES];

[self.navigationController popViewControlleranimated:YES];

15分
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:你父页面的位置,我感觉你可以填0] animated:YES];

如果你说的父页面是根基视图的话也可以这样:

[self.navigationController popToRootViewControllerAnimated:YES]

15分
[self.navigationController popToRootViewControllerAnimated:YES]

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明父页面连续push3个view 。如何从ControlView3 返回父页面并刷新父页面?