小编Rod*_*rio的帖子

使用选择器的覆盖方法具有不兼容的类型 - Swift

重写UITableViewDelegatetableView:cellForRowAtIndexPath:导致以下编译错误:

使用选择器'tableView:cellForRowAtIndexPath:'的覆盖方法具有不兼容的类型'(UITableView!,NSIndexPath!) - > UITableViewCell!'

覆盖函数的当前实现是:

override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!
{
    let cell = tableView.dequeueReusableCellWithIdentifier("cellIdent", forIndexPath: indexPath) as UITableViewCell

    // Configure the cell...

    return cell
}
Run Code Online (Sandbox Code Playgroud)

导致错误的原因是什么?

ios swift

4
推荐指数
1
解决办法
1278
查看次数

标签 统计

ios ×1

swift ×1