第一:cell从用
if(cell) {
UIView *oldView = [cell viewWithTag:101];
[oldView removeFromSuperview];
}
UIView *newView = [dataArray objectAtIndex:indexPath.row];
[cell addSubview:newView];
第二:cell中的视图或者数据从用
自定义cell,继承于UITableViewCell的类,在初始化方法中添加控件
if(cell) {
UIView *oldView = [cell viewWithTag:101];
[oldView removeFromSuperview];
}
UIView *newView = [dataArray objectAtIndex:indexPath.row];
[cell addSubview:newView];
自定义cell,继承于UITableViewCell的类,在初始化方法中添加控件