Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 575
some_id Avatar asked Feb 26 '11 02:02

some_id


1 Answers

    NSArray *viewsToRemove = [scrollView subviews];
    for (UIView *v in viewsToRemove) [v removeFromSuperview];
like image 88
bioffe Avatar answered Oct 19 '22 15:10

bioffe