Я назначаю какое-то пользовательское представление для UITableViewCell.accessoryView
, но если я прокручиваю tableView с ума, некоторые accessoryView
исчезнут в iOS 7, и если я коснусь ячейки, может появиться accessoryView
, я не знаю почему, потому что это правильно в iOS 6. Это мой код, кто-нибудь может мне помочь?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [NSString stringWithFormat:@"CELL %d", (int)indexPath.row+1];
NSDictionary * dict = [_dataSource objectAtIndex:indexPath.row];
if ([dict objectForKey:@"switch"])
{
cell.accessoryView = [dict objectForKey:@"switch"];
}
else
{
cell.accessoryView = nil;
}
return cell;
}