首页 > 代码库 > uiview 删除某个指定view类的代码块

uiview 删除某个指定view类的代码块

- (void)removeDynamictItemView:(UIView *)view

{

    NSMutableArray *itemesToRemove = [NSMutableArrayarray];

    for (UIView *subviewin view.subviews) {

        if ([subview isKindOfClass:[TBCouponDynamictItemViewclass]]) {

            [itemesToRemove addObject:subview];

        }else{

            [self removeDynamictItemView:subview];

        }

    }

    [itemesToRemove makeObjectsPerformSelector:@selector(removeFromSuperview)];


}