UITableViewCellAccessoryCheckmark未在iOS 7中显示

wvp*_*wvp 7 xcode objective-c uitableview ios

我在单元格中显示Checkmark附件时出现问题.当我使用其他类型的配件时,它可以工作,但不能使用Checkmark附件.

它在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;
}
Run Code Online (Sandbox Code Playgroud)

fre*_* AR 23

我解决了这个问题,改变了uitableview的色调

我通过InterfaceBuilder将uint的tintcolot更改为Default color

要么

TableView.tintColor =  [UIColor blackColor];
Run Code Online (Sandbox Code Playgroud)


che*_*ewy 0

就像现实检查一样,因为您的代码看起来没问题,您可以将 [event.current boolValue] 更改为 YES ,看来问题实际上在于值中......我还将检查表视图的委托。

如果不是这个或那个,请告诉我们......我会删除这个答案......

if (YES) {
//..
}
Run Code Online (Sandbox Code Playgroud)