1.Removing allCustom Views
[view makeObjectsPerformSelector:@selector(removeFromSuperview)];
[view removeAllObjects];
2.what you want to removed
int i =0;
for(CustomView *view in arrayView)
{
NSLog(@"View tag:%d",view.tag);
if(view.viewTag == 1)
{
[view removeFromSuperview];
[arrayView removeObjectAtIndex:i];
}
++i;
}
You could distinguish from generated buttons by setting a
tag
on your other buttons, if the button has no tag then remove it.example: I set [self setViewTag:1],so I Can removed what I want to remove Custom View.