【问题标题】:Legacy cell layout?旧版单元格布局?
【发布时间】:2011-10-08 03:58:38
【问题描述】:

我的控制台出现了这个问题,这是什么意思,我该如何解决?

2011-07-18 22:08:31.004 App[4176:707] 警告:由于 中 tableView:accessoryTypeForRowWithIndexPath: 的委托实现,使用旧版单元格布局。请删除此方法的实现并设置单元格属性附件类型和/或编辑附件类型以移动到新的单元格布局行为。以后的版本中将不再调用此方法。

编辑:这是 iOS,方法如下:

    - (UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath
{

    switch (indexPath.row) {

        case 2:
            return UITableViewCellAccessoryDisclosureIndicator;
            break;

        case 3:
            return UITableViewCellAccessoryDisclosureIndicator;
            break;

        case 4:
            return UITableViewCellAccessoryDisclosureIndicator;
            break;

    }
    return UITableViewCellAccessoryNone;
}

【问题讨论】:

标签: ios uitableview cell


【解决方案1】:

这意味着您正在实现一个不推荐使用的方法,并且系统因此使用向后兼容模式。

您应该完全按照消息的建议进行操作:删除您对 tableView:accessoryTypeForRowWithIndexPath: 的实现,而是将适当的值分配给 accessoryType 和/或 editingAccessoryType 属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-26
    • 2015-08-19
    • 2017-05-07
    相关资源
    最近更新 更多