首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

父页面连续push3个view 。怎么从ControlView3 返回父页面并刷新父页面

2012-01-19 
父页面连续push3个view 。如何从ControlView3返回父页面并刷新父页面?[self.navigationController pushView

父页面连续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出去。然后调用父页面的一个方法,刷新父页面

[解决办法]
用到委托。你可以在ControlView3里定义一个委托。从ControlView3里退出的地方调用这个委托。

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

[self.navigationController popViewControlleranimated:YES];

[self.navigationController popViewControlleranimated:YES];


[self.navigationController popViewControlleranimated:YES];
[解决办法]
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:你父页面的位置,我感觉你可以填0] animated:YES];

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

[self.navigationController popToRootViewControllerAnimated:YES]
[解决办法]
[self.navigationController popToRootViewControllerAnimated:YES]

热点排行