Swift 3使用“行”
我刚刚迁移到indexPath
3,我得到这个错误模糊使用indexPath
row
上相同的section
和item
。
其他属性就像count
一样工作。
很可能是因为推断。
这是模糊的:
这里是完整的日志截图:
我正在使用AlecrimCoreData
第三方,它有以下扩展名:
// MARK: - IndexPath extensions extension IndexPath { public init(forRow row: Int, inSection section: Int) { self.init(indexes: [section, row]) } //public var section: Int { return self[0] } public var row: Int { return self[1] } }
如果我只是注释掉这一行public var row: Int { return self[1] }
我的代码编译成功。
AlecrimCoreData为IndexPath定义一个row
属性,与UIKit中定义的现有row
属性冲突。
删除AlecrimCoreData中的定义来解决问题。