首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

uitableview cell 数据反复

2012-12-07 
uitableviewcell 数据重复- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPa

uitableview cell 数据重复

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {    NSString *CellIdentifier = @"Cell";    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];    if (cell == nil) {        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];    }else{        while ([cell.contentView.subviews lastObject] != nil) {            [(UIView*)[cell.contentView.subviews lastObject] removeFromSuperview];  //删除并进行重新分配        }    }

热点排行