小编ahm*_*med的帖子

我如何在 swift 3 的一个视图控制器中填充两个不同的表视图

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    if tableView == table1{
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! acntTableViewCell
        cell.account.text = account[indexPath.row].email
        return cell
    }
    else if tableView == table2 {
        let cell2 = tableView.dequeueReusableCell(withIdentifier: "cell2")
            as! popTableViewCell

        cell2.pop.text = pop[indexPath.row].answer
        return cell2
    }
}//its give me  error here Missing return  in function
Run Code Online (Sandbox Code Playgroud)

我将在一个视图控制器中填充两个不同的表。当我返回单元格时,它给我错误我做错的函数中缺少返回值,任何人都可以告诉我这段代码有什么问题

uitableview ios swift

5
推荐指数
2
解决办法
6239
查看次数

标签 统计

ios ×1

swift ×1

uitableview ×1