【发布时间】:2010-06-23 01:59:02
【问题描述】:
在 appdidfinishlaunch 中,我正在加载一个 tabbarcontroller 作为子视图,然后我加载另一个视图
MySubView * mySubView = [[MySubView alloc] init];
[window addSubview:mySubView];
[mySubView release];
我想在子视图中通过单击按钮来关闭顶层,所以我设置了一个 IBAction 并尝试了不同的方法来强制关闭实际视图:
// 1.
[self.view removeFromSuperview];
// 2.
id *delegate = [[UIApplication sharedApplication] delegate];
[[[delegate view] objectAtIndex:0] removeFromSuperview];
//3.
[[[delegate window] view] removeFromSuperview];
那么我怎样才能从窗口弹出这个子视图呢?
干杯 西蒙
【问题讨论】: