我在我的单元格中显示勾选标记附件的时候遇到了问题。当我使用其他类型的附件时,它可以正常工作,但是使用勾选标记附件时就不行。
在iOS 6中可以完美工作,但是在iOS 7上却不行。我错过了什么?
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:EVENT_SELECTION_CELL_IDENTIFIER forIndexPath:indexPath];
Event *event = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = event.name;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if ([event.current boolValue]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
return cell;
}
float version = [[[UIDevice currentDevice] systemVersion] floatValue]; if (version >= 7.0) { cell.selectionStyle = UITableViewCellSelectionStyleDefault; } else{ cell.selectionStyle = UITableViewCellSelectionStyleNone; }
- Pradeep Mahdevu