Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 我怎样才能排除视图?_Objective C_Cocoa Touch_Uiviewcontroller - Fatal编程技术网

Objective c 我怎样才能排除视图?

Objective c 我怎样才能排除视图?,objective-c,cocoa-touch,uiviewcontroller,Objective C,Cocoa Touch,Uiviewcontroller,如果我像这样添加视图:[myView addSubview:viewController.view]如何取消它并获得旧视图。例如,单击按钮 -(IBAction)dismiss{ //some code } 谢谢像我这样?[self.view removeFromSuperview]像我这样?[self.view从SuperView移除] [viewController.view removeFromSuperview]; if ([viewController.view superView

如果我像这样添加视图:
[myView addSubview:viewController.view]如何取消它并获得旧视图。例如,单击按钮

-(IBAction)dismiss{
//some code
}

谢谢

像我这样?[self.view removeFromSuperview]像我这样?[self.view从SuperView移除]
[viewController.view removeFromSuperview];
if ([viewController.view superView])

{

      [viewController.view removeFromSuperview];

}