Permalink
Browse files

Use makeObjectsPerformSelector: to remove subviews

  • Loading branch information...
1 parent 8def4bc commit 9ca748720223d7f93bf038be780f3095cc88a423 @danielctull committed Sep 16, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 UIView+DCTSubviewExtensions.m
@@ -39,8 +39,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@implementation UIView (DCTSubviewExtensions)
- (void)dct_removeAllSubviews {
- while ([self.subviews count] > 0)
- [[self.subviews lastObject] removeFromSuperview];
+ [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
}
- (id)dct_subviewOfKindOfClass:(Class)aClass {

0 comments on commit 9ca7487

Please sign in to comment.