开发者

How to remove a subView

开发者 https://www.devze.com 2023-01-04 06:55 出处:网络
I added a subview using myViewController *myVC = [[myViewController alloc] initWithNibName:@\"myView\" bundle:nil];

I added a subview using

myViewController *myVC = [[myViewController alloc] initWithNibName:@"myView" bundle:nil];
[self addSubview:myVC.view];
[myVC release];

how can I remove it again from a myViewController me开发者_如何转开发thod ?

I tried

[self.view removeFromSuperview];

but that doesn't work


Try this:

[myVC.view removeFromSuperview]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号