您的位置:首页 > 其它

[Cocoa]_[初级]_[Removing All Custom Views or what you want to removed]

2014-09-22 18:51 435 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐