Helium3 Helium3 - 27 days ago 14
iOS Question

Removing subviews from UIScrollView

I need to remove image

subviews
from a
ScrollView
and I tried removing from the
array
of
subviews
but that is an
NSArray
which is immutable.

How can a
subview
be removed from the
scrollviews array
of
subviews
?

Answer
    NSArray *viewsToRemove = [scrollView subviews];
    for (UIView *v in viewsToRemove) [v removeFromSuperview];