outlet collection removefromsuperview

时间:2015-01-22 00:37:44

标签: uiview ios8 xib

我有一个outlet集合,并尝试通过从集合数组访问它并调用removefromsuperview来删除其中一个视图。最终删除了从界面构建器附加到集合的所有视图。任何帮助将不胜感激!

assignments.removeAtIndex(i).removeFromSuperview()

https://www.dropbox.com/s/pglhob9uyflv8kn/ass.tiff?dl=0

1 个答案:

答案 0 :(得分:0)

assignments.removeAtIndex(i).removeFromSuperview()您首先要从分配数组中删除对象,然后在整个阵列上调用removeFromSuperview

看起来你应该做的只是assignments[i].removeFromSuperview()

相关问题