当我点击UIButton时,我使用下面的代码将另一个UIViewController显示为叠加
self.viewObj= [self.storyboard instantiateViewControllerWithIdentifier:@"list"];
self.viewObj.view.frame = CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height);
self.viewObj.view.layer.opacity=0.95;
[self.view addSubview:self.viewObj.view];
[self addChildViewController:self.viewObj];
这样做很好,但现在如何从父视图中删除新的UIViewController
?
我尝试了以下代码并且无法正常工作
self.viewObj= [self.storyboard instantiateViewControllerWithIdentifier:@"list"];
[self.viewObj removeFromParentViewController];
请帮忙
UPDATE 在新的viewcontroller中
ParentViewController *upObj=[[ParentViewController alloc]init];
[upObj removePage];
在ParentViewController中,removePage()
我有以下代码
[self.viewObj removeFromParentViewController];