第一: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的類,在初始化方法中添加控件