在创建cell的时候没什么问题吧?求大神!!!
代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"SimpleTableIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
int row = [indexPath row];
NetContactersModel *model = [self.netContacters objectAtIndex: row];
cell.textLabel.text = model.userName;
return cell;
}
------解决方案--------------------
创建没问题。选项的代码你可以贴上来看看。
------解决方案--------------------
重用了同一个cell的问题,
在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
里面判断下,重新设置下选中状态