无法填充UITableViewCell

时间:2015-02-06 20:44:38

标签: ios uitableview swift

我正在尝试使用数组中的数据填充UITableView的一行 以下函数永远不会被调用:

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

        // Configure the cell...


        cell.textLabel?.text = arrayOfDictionaryPlaces[indexPath.row]["name"];
        println("the Cell");

        return cell
    }

我已将原型单元格可重用标识符设置为“单元格”,并通过设置其类(viewDidLoad被调用)来控制表。

任何意见都赞赏。

1 个答案:

答案 0 :(得分:0)

部分的数量设置为零,所以我改为1,数据填充行,是否有理由为什么数字odf部分默认设置为0?

 override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        // #warning Potentially incomplete method implementation.
        // Return the number of sections.
        return 1
    }
相关问题