iphone - 从 super View 中删除多个 View

标签 iphone ios xcode ipad sdk

当使用这个方法时,我需要同时从 superview 中删除几个 UIViews :

[view1 , view 2 , vie3 removeFromSuperview]; 

编译器给我一个警告:

**warning: Unused Entity Issue: Expression result unused**

如何才能做到正确?

最佳答案

或者,如果您想从某个 View 中删除所有 subview :

for (UIView *subview in view.subviews) {
    [subview removeFromSuperview];
}

关于iphone - 从 super View 中删除多个 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9088582/

相关文章:

objective-c - 在特定时间执行选择器

ios - Cordova ,错误 : does not appear to be an xcode project (no xcode project file) when installing plugins

ios - 如何在ios中将图像添加为圆形框架

xcode - Swift:为什么这个有效的表达式在以三元形式表示时会失败?

iphone - Xcode - Storyboard - 导航 Controller

ios - 如何让我的 UICollectionView 返回 3 列,它们之间的间距为 1 像素,就像 instagram 一样? swift

iphone - 向 UIView 添加组合框或下拉列表

ios - Xcode 8 Memory Graph 说 "No selection"并且不工作

iphone - 尝试更改 CGImageRef 数据中的像素时获取 RGB 0 值

iphone - for循环中的EXC_BAD_ACCESS